ui: Remove non-slimming paint code paths.
[chromium-blink-merge.git] / ui / compositor / paint_context.cc
blob36a61262b87bb8780e03197653f12b4db3148392
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/compositor/paint_context.h"
7 #include "third_party/skia/include/core/SkPictureRecorder.h"
8 #include "ui/gfx/canvas.h"
10 namespace ui {
12 PaintContext::PaintContext(cc::DisplayItemList* list,
13 float device_scale_factor,
14 const gfx::Rect& bounds,
15 const gfx::Rect& invalidation)
16 : list_(list),
17 owned_recorder_(new SkPictureRecorder),
18 recorder_(owned_recorder_.get()),
19 device_scale_factor_(device_scale_factor),
20 bounds_(bounds),
21 invalidation_(invalidation) {
22 #if DCHECK_IS_ON()
23 root_visited_ = nullptr;
24 inside_paint_recorder_ = false;
25 #endif
28 PaintContext::PaintContext(const PaintContext& other,
29 const gfx::Vector2d& offset)
30 : list_(other.list_),
31 owned_recorder_(nullptr),
32 recorder_(other.recorder_),
33 device_scale_factor_(other.device_scale_factor_),
34 bounds_(other.bounds_),
35 invalidation_(other.invalidation_),
36 offset_(other.offset_ + offset) {
37 #if DCHECK_IS_ON()
38 root_visited_ = other.root_visited_;
39 inside_paint_recorder_ = other.inside_paint_recorder_;
40 #endif
43 PaintContext::PaintContext(const PaintContext& other,
44 CloneWithoutInvalidation c)
45 : list_(other.list_),
46 owned_recorder_(nullptr),
47 recorder_(other.recorder_),
48 device_scale_factor_(other.device_scale_factor_),
49 bounds_(other.bounds_),
50 invalidation_(),
51 offset_(other.offset_) {
52 #if DCHECK_IS_ON()
53 root_visited_ = other.root_visited_;
54 inside_paint_recorder_ = other.inside_paint_recorder_;
55 #endif
58 PaintContext::~PaintContext() {
61 } // namespace ui