OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_LAYER_HELPER_H_ | 5 #ifndef VIEWS_LAYER_HELPER_H_ |
6 #define VIEWS_LAYER_HELPER_H_ | 6 #define VIEWS_LAYER_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 void SetLayer(ui::Layer* layer); | 36 void SetLayer(ui::Layer* layer); |
37 ui::Layer* layer() { return layer_.get(); } | 37 ui::Layer* layer() { return layer_.get(); } |
38 | 38 |
39 // Rectangle that needs to be painted. | 39 // Rectangle that needs to be painted. |
40 void set_clip_rect(const gfx::Rect& rect) { | 40 void set_clip_rect(const gfx::Rect& rect) { |
41 clip_rect_ = rect; | 41 clip_rect_ = rect; |
42 } | 42 } |
43 const gfx::Rect& clip_rect() const { return clip_rect_; } | 43 const gfx::Rect& clip_rect() const { return clip_rect_; } |
44 | 44 |
45 // If true, the layer's bitmap is out of date and needs to be updated. | |
46 void set_bitmap_needs_updating(bool value) { | |
47 bitmap_needs_updating_ = value; | |
48 } | |
49 bool bitmap_needs_updating() const { | |
50 return bitmap_needs_updating_; | |
51 } | |
52 | |
53 // If true the layer was explicitly turned on. | 45 // If true the layer was explicitly turned on. |
54 void set_paint_to_layer(bool value) { paint_to_layer_ = value; } | 46 void set_paint_to_layer(bool value) { paint_to_layer_ = value; } |
55 bool paint_to_layer() const { return paint_to_layer_; } | 47 bool paint_to_layer() const { return paint_to_layer_; } |
56 | 48 |
57 // See description in View for details | 49 // See description in View for details |
58 void set_fills_bounds_opaquely(bool fills_bounds_opaquely) { | 50 void set_fills_bounds_opaquely(bool fills_bounds_opaquely) { |
59 fills_bounds_opaquely_ = fills_bounds_opaquely; | 51 fills_bounds_opaquely_ = fills_bounds_opaquely; |
60 } | 52 } |
61 bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } | 53 bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } |
62 | 54 |
(...skipping 30 matching lines...) Expand all Loading... |
93 | 85 |
94 scoped_ptr<ui::Layer> layer_; | 86 scoped_ptr<ui::Layer> layer_; |
95 | 87 |
96 scoped_ptr<LayerPropertySetter> property_setter_; | 88 scoped_ptr<LayerPropertySetter> property_setter_; |
97 | 89 |
98 // Used during painting. If not empty and View::Paint() is invoked, the canvas | 90 // Used during painting. If not empty and View::Paint() is invoked, the canvas |
99 // is created with the specified size. | 91 // is created with the specified size. |
100 // TODO(sky): this should be passed into paint. | 92 // TODO(sky): this should be passed into paint. |
101 gfx::Rect clip_rect_; | 93 gfx::Rect clip_rect_; |
102 | 94 |
103 // Is the layers bitmap out of date? | |
104 bool bitmap_needs_updating_; | |
105 | |
106 bool fills_bounds_opaquely_; | 95 bool fills_bounds_opaquely_; |
107 | 96 |
108 // If true the bitmap is always up to date. | 97 // If true the bitmap is always up to date. |
109 bool layer_updated_externally_; | 98 bool layer_updated_externally_; |
110 | 99 |
111 // Should the View paint to a layer? | 100 // Should the View paint to a layer? |
112 bool paint_to_layer_; | 101 bool paint_to_layer_; |
113 | 102 |
114 bool property_setter_explicitly_set_; | 103 bool property_setter_explicitly_set_; |
115 | 104 |
116 bool needs_paint_all_; | 105 bool needs_paint_all_; |
117 | 106 |
118 DISALLOW_COPY_AND_ASSIGN(LayerHelper); | 107 DISALLOW_COPY_AND_ASSIGN(LayerHelper); |
119 }; | 108 }; |
120 | 109 |
121 } // namespace internal | 110 } // namespace internal |
122 | 111 |
123 } // namespace views | 112 } // namespace views |
124 | 113 |
125 #endif // VIEWS_LAYER_HELPER_H_ | 114 #endif // VIEWS_LAYER_HELPER_H_ |
OLD | NEW |