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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/compositor/compositor_export.h" | 10 #include "ui/compositor/compositor_export.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // don't want to expose them on this class so that people must go through the | 73 // don't want to expose them on this class so that people must go through the |
74 // recorders to access them. | 74 // recorders to access them. |
75 friend class ClipRecorder; | 75 friend class ClipRecorder; |
76 friend class CompositingRecorder; | 76 friend class CompositingRecorder; |
77 friend class PaintRecorder; | 77 friend class PaintRecorder; |
78 friend class TransformRecorder; | 78 friend class TransformRecorder; |
79 // The Cache class also needs to access the DisplayItemList to append its | 79 // The Cache class also needs to access the DisplayItemList to append its |
80 // cache contents. | 80 // cache contents. |
81 friend class PaintCache; | 81 friend class PaintCache; |
82 | 82 |
| 83 // Returns a rect with the given size in the space of the context's |
| 84 // containing layer. |
| 85 gfx::Rect ToLayerSpaceBounds(const gfx::Size& size_in_layer) const; |
| 86 |
| 87 // Returns the given rect translated by the layer space offset. |
| 88 gfx::Rect ToLayerSpaceRect(const gfx::Rect& rect) const; |
| 89 |
83 cc::DisplayItemList* list_; | 90 cc::DisplayItemList* list_; |
84 scoped_ptr<SkPictureRecorder> owned_recorder_; | 91 scoped_ptr<SkPictureRecorder> owned_recorder_; |
85 // A pointer to the |owned_recorder_| in this PaintContext, or in another one | 92 // A pointer to the |owned_recorder_| in this PaintContext, or in another one |
86 // which this was copied from. We expect a copied-from PaintContext to outlive | 93 // which this was copied from. We expect a copied-from PaintContext to outlive |
87 // copies made from it. | 94 // copies made from it. |
88 SkPictureRecorder* recorder_; | 95 SkPictureRecorder* recorder_; |
89 // The device scale of the frame being painted. Used to determine which bitmap | 96 // The device scale of the frame being painted. Used to determine which bitmap |
90 // resources to use in the frame. | 97 // resources to use in the frame. |
91 float device_scale_factor_; | 98 float device_scale_factor_; |
92 // Invalidation in the space of the paint root (ie the space of the layer | 99 // Invalidation in the space of the paint root (ie the space of the layer |
(...skipping 11 matching lines...) Expand all Loading... |
104 // recorder is active. | 111 // recorder is active. |
105 mutable bool inside_paint_recorder_; | 112 mutable bool inside_paint_recorder_; |
106 #endif | 113 #endif |
107 | 114 |
108 DISALLOW_COPY_AND_ASSIGN(PaintContext); | 115 DISALLOW_COPY_AND_ASSIGN(PaintContext); |
109 }; | 116 }; |
110 | 117 |
111 } // namespace ui | 118 } // namespace ui |
112 | 119 |
113 #endif // UI_COMPOSITOR_PAINT_CONTEXT_H_ | 120 #endif // UI_COMPOSITOR_PAINT_CONTEXT_H_ |
OLD | NEW |