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 #ifndef UI_COMPOSITOR_PAINT_CONTEXT_H_ | 5 #ifndef UI_COMPOSITOR_PAINT_CONTEXT_H_ |
6 #define UI_COMPOSITOR_PAINT_CONTEXT_H_ | 6 #define UI_COMPOSITOR_PAINT_CONTEXT_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ui/gfx/geometry/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 | 60 |
61 #if DCHECK_IS_ON() | 61 #if DCHECK_IS_ON() |
62 void Visited(void* visited) const { | 62 void Visited(void* visited) const { |
63 if (!root_visited_) | 63 if (!root_visited_) |
64 root_visited_ = visited; | 64 root_visited_ = visited; |
65 } | 65 } |
66 void* RootVisited() const { return root_visited_; } | 66 void* RootVisited() const { return root_visited_; } |
67 const gfx::Vector2d& PaintOffset() const { return offset_; } | 67 const gfx::Vector2d& PaintOffset() const { return offset_; } |
68 #endif | 68 #endif |
69 | 69 |
70 const gfx::Rect& InvalidationForTesting() const { return invalidation_; } | |
sadrul
2015/04/07 19:05:12
In a number of components, we expose such things t
danakj
2015/04/07 20:09:35
FWIW Presubmit makes an error if you use a method
| |
71 | |
70 private: | 72 private: |
71 // The PaintRecorder needs access to the internal canvas and friends, but we | 73 // The PaintRecorder needs access to the internal canvas and friends, but we |
72 // don't want to expose them on this class so that people must go through the | 74 // don't want to expose them on this class so that people must go through the |
73 // recorder to access them. | 75 // recorder to access them. |
74 friend class PaintRecorder; | 76 friend class PaintRecorder; |
75 | 77 |
76 // Clone a PaintContext with an additional |offset|. | 78 // Clone a PaintContext with an additional |offset|. |
77 PaintContext(const PaintContext& other, const gfx::Vector2d& offset) | 79 PaintContext(const PaintContext& other, const gfx::Vector2d& offset) |
78 : canvas_(other.canvas_), | 80 : canvas_(other.canvas_), |
79 invalidation_(other.invalidation_), | 81 invalidation_(other.invalidation_), |
(...skipping 14 matching lines...) Expand all Loading... | |
94 #if DCHECK_IS_ON() | 96 #if DCHECK_IS_ON() |
95 // Used to verify that the |invalidation_| is only used to compare against | 97 // Used to verify that the |invalidation_| is only used to compare against |
96 // rects in the same space. | 98 // rects in the same space. |
97 mutable void* root_visited_; | 99 mutable void* root_visited_; |
98 #endif | 100 #endif |
99 }; | 101 }; |
100 | 102 |
101 } // namespace ui | 103 } // namespace ui |
102 | 104 |
103 #endif // UI_COMPOSITOR_PAINT_CONTEXT_H_ | 105 #endif // UI_COMPOSITOR_PAINT_CONTEXT_H_ |
OLD | NEW |