OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/compositor/paint_context.h" | 5 #include "ui/compositor/paint_context.h" |
6 | 6 |
7 #include "third_party/skia/include/core/SkPictureRecorder.h" | 7 #include "third_party/skia/include/core/SkPictureRecorder.h" |
8 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 20 matching lines...) Expand all Loading... |
31 recorder_(owned_recorder_.get()), | 31 recorder_(owned_recorder_.get()), |
32 device_scale_factor_(device_scale_factor), | 32 device_scale_factor_(device_scale_factor), |
33 bounds_(bounds), | 33 bounds_(bounds), |
34 invalidation_(invalidation) { | 34 invalidation_(invalidation) { |
35 #if DCHECK_IS_ON() | 35 #if DCHECK_IS_ON() |
36 root_visited_ = nullptr; | 36 root_visited_ = nullptr; |
37 inside_paint_recorder_ = false; | 37 inside_paint_recorder_ = false; |
38 #endif | 38 #endif |
39 } | 39 } |
40 | 40 |
41 PaintContext::PaintContext(gfx::Canvas* canvas) | |
42 : PaintContext(canvas, gfx::Rect()) { | |
43 } | |
44 | |
45 PaintContext::PaintContext(const PaintContext& other, | 41 PaintContext::PaintContext(const PaintContext& other, |
46 const gfx::Vector2d& offset) | 42 const gfx::Vector2d& offset) |
47 : canvas_(other.canvas_), | 43 : canvas_(other.canvas_), |
48 list_(other.list_), | 44 list_(other.list_), |
49 owned_recorder_(nullptr), | 45 owned_recorder_(nullptr), |
50 recorder_(other.recorder_), | 46 recorder_(other.recorder_), |
51 device_scale_factor_(other.device_scale_factor_), | 47 device_scale_factor_(other.device_scale_factor_), |
52 bounds_(other.bounds_), | 48 bounds_(other.bounds_), |
53 invalidation_(other.invalidation_), | 49 invalidation_(other.invalidation_), |
54 offset_(other.offset_ + offset) { | 50 offset_(other.offset_ + offset) { |
(...skipping 16 matching lines...) Expand all Loading... |
71 #if DCHECK_IS_ON() | 67 #if DCHECK_IS_ON() |
72 root_visited_ = other.root_visited_; | 68 root_visited_ = other.root_visited_; |
73 inside_paint_recorder_ = other.inside_paint_recorder_; | 69 inside_paint_recorder_ = other.inside_paint_recorder_; |
74 #endif | 70 #endif |
75 } | 71 } |
76 | 72 |
77 PaintContext::~PaintContext() { | 73 PaintContext::~PaintContext() { |
78 } | 74 } |
79 | 75 |
80 } // namespace ui | 76 } // namespace ui |
OLD | NEW |