OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 CC_LAYERS_LAYER_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 Layer* child_at(size_t index) { return children_[index].get(); } | 95 Layer* child_at(size_t index) { return children_[index].get(); } |
96 | 96 |
97 // This requests the layer and its subtree be rendered and given to the | 97 // This requests the layer and its subtree be rendered and given to the |
98 // callback. If the copy is unable to be produced (the layer is destroyed | 98 // callback. If the copy is unable to be produced (the layer is destroyed |
99 // first), then the callback is called with a NULL/empty result. | 99 // first), then the callback is called with a NULL/empty result. |
100 void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> request); | 100 void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> request); |
101 bool HasCopyRequest() const { | 101 bool HasCopyRequest() const { |
102 return !copy_requests_.empty(); | 102 return !copy_requests_.empty(); |
103 } | 103 } |
104 | 104 |
105 void SetAnchorPoint(gfx::PointF anchor_point); | 105 void SetAnchorPoint(const gfx::PointF& anchor_point); |
106 gfx::PointF anchor_point() const { return anchor_point_; } | 106 gfx::PointF anchor_point() const { return anchor_point_; } |
107 | 107 |
108 void SetAnchorPointZ(float anchor_point_z); | 108 void SetAnchorPointZ(float anchor_point_z); |
109 float anchor_point_z() const { return anchor_point_z_; } | 109 float anchor_point_z() const { return anchor_point_z_; } |
110 | 110 |
111 virtual void SetBackgroundColor(SkColor background_color); | 111 virtual void SetBackgroundColor(SkColor background_color); |
112 SkColor background_color() const { return background_color_; } | 112 SkColor background_color() const { return background_color_; } |
113 // If contents_opaque(), return an opaque color else return a | 113 // If contents_opaque(), return an opaque color else return a |
114 // non-opaque color. Tries to return background_color(), if possible. | 114 // non-opaque color. Tries to return background_color(), if possible. |
115 SkColor SafeOpaqueBackgroundColor() const; | 115 SkColor SafeOpaqueBackgroundColor() const; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // they are viewed through non-opaque regions in this layer. They are used | 158 // they are viewed through non-opaque regions in this layer. They are used |
159 // through the WebLayer interface, and are not exposed to HTML. | 159 // through the WebLayer interface, and are not exposed to HTML. |
160 void SetBackgroundFilters(const FilterOperations& filters); | 160 void SetBackgroundFilters(const FilterOperations& filters); |
161 const FilterOperations& background_filters() const { | 161 const FilterOperations& background_filters() const { |
162 return background_filters_; | 162 return background_filters_; |
163 } | 163 } |
164 | 164 |
165 virtual void SetContentsOpaque(bool opaque); | 165 virtual void SetContentsOpaque(bool opaque); |
166 bool contents_opaque() const { return contents_opaque_; } | 166 bool contents_opaque() const { return contents_opaque_; } |
167 | 167 |
168 void SetPosition(gfx::PointF position); | 168 void SetPosition(const gfx::PointF& position); |
169 gfx::PointF position() const { return position_; } | 169 gfx::PointF position() const { return position_; } |
170 | 170 |
171 void SetIsContainerForFixedPositionLayers(bool container); | 171 void SetIsContainerForFixedPositionLayers(bool container); |
172 bool IsContainerForFixedPositionLayers() const; | 172 bool IsContainerForFixedPositionLayers() const; |
173 | 173 |
174 void SetPositionConstraint(const LayerPositionConstraint& constraint); | 174 void SetPositionConstraint(const LayerPositionConstraint& constraint); |
175 const LayerPositionConstraint& position_constraint() const { | 175 const LayerPositionConstraint& position_constraint() const { |
176 return position_constraint_; | 176 return position_constraint_; |
177 } | 177 } |
178 | 178 |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 DrawProperties<Layer> draw_properties_; | 621 DrawProperties<Layer> draw_properties_; |
622 | 622 |
623 PaintProperties paint_properties_; | 623 PaintProperties paint_properties_; |
624 | 624 |
625 DISALLOW_COPY_AND_ASSIGN(Layer); | 625 DISALLOW_COPY_AND_ASSIGN(Layer); |
626 }; | 626 }; |
627 | 627 |
628 } // namespace cc | 628 } // namespace cc |
629 | 629 |
630 #endif // CC_LAYERS_LAYER_H_ | 630 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |