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