OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_LAYERS_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 LayerImpl* scroll_parent() { return scroll_parent_; } | 132 LayerImpl* scroll_parent() { return scroll_parent_; } |
133 const LayerImpl* scroll_parent() const { return scroll_parent_; } | 133 const LayerImpl* scroll_parent() const { return scroll_parent_; } |
134 | 134 |
135 void SetScrollChildren(std::set<LayerImpl*>* children); | 135 void SetScrollChildren(std::set<LayerImpl*>* children); |
136 | 136 |
137 std::set<LayerImpl*>* scroll_children() { return scroll_children_.get(); } | 137 std::set<LayerImpl*>* scroll_children() { return scroll_children_.get(); } |
138 const std::set<LayerImpl*>* scroll_children() const { | 138 const std::set<LayerImpl*>* scroll_children() const { |
139 return scroll_children_.get(); | 139 return scroll_children_.get(); |
140 } | 140 } |
141 | 141 |
| 142 void SetNumDescendantsThatDrawContent(int num_descendants); |
142 void SetClipParent(LayerImpl* ancestor); | 143 void SetClipParent(LayerImpl* ancestor); |
143 | 144 |
144 LayerImpl* clip_parent() { | 145 LayerImpl* clip_parent() { |
145 return clip_parent_; | 146 return clip_parent_; |
146 } | 147 } |
147 const LayerImpl* clip_parent() const { | 148 const LayerImpl* clip_parent() const { |
148 return clip_parent_; | 149 return clip_parent_; |
149 } | 150 } |
150 | 151 |
151 void SetClipChildren(std::set<LayerImpl*>* children); | 152 void SetClipChildren(std::set<LayerImpl*>* children); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 virtual void UpdateTiles( | 204 virtual void UpdateTiles( |
204 const OcclusionTracker<LayerImpl>* occlusion_tracker) {} | 205 const OcclusionTracker<LayerImpl>* occlusion_tracker) {} |
205 virtual void NotifyTileStateChanged(const Tile* tile) {} | 206 virtual void NotifyTileStateChanged(const Tile* tile) {} |
206 | 207 |
207 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); | 208 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); |
208 | 209 |
209 // Returns true if this layer has content to draw. | 210 // Returns true if this layer has content to draw. |
210 void SetDrawsContent(bool draws_content); | 211 void SetDrawsContent(bool draws_content); |
211 bool DrawsContent() const { return draws_content_; } | 212 bool DrawsContent() const { return draws_content_; } |
212 | 213 |
| 214 int NumDescendantsThatDrawContent() const; |
213 void SetHideLayerAndSubtree(bool hide); | 215 void SetHideLayerAndSubtree(bool hide); |
214 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } | 216 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } |
215 | 217 |
216 bool force_render_surface() const { return force_render_surface_; } | 218 bool force_render_surface() const { return force_render_surface_; } |
217 void SetForceRenderSurface(bool force) { force_render_surface_ = force; } | 219 void SetForceRenderSurface(bool force) { force_render_surface_ = force; } |
218 | 220 |
219 void SetTransformOrigin(const gfx::Point3F& transform_origin); | 221 void SetTransformOrigin(const gfx::Point3F& transform_origin); |
220 gfx::Point3F transform_origin() const { return transform_origin_; } | 222 gfx::Point3F transform_origin() const { return transform_origin_; } |
221 | 223 |
222 void SetBackgroundColor(SkColor background_color); | 224 void SetBackgroundColor(SkColor background_color); |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 SkXfermode::Mode blend_mode_; | 645 SkXfermode::Mode blend_mode_; |
644 gfx::PointF position_; | 646 gfx::PointF position_; |
645 gfx::Transform transform_; | 647 gfx::Transform transform_; |
646 | 648 |
647 LayerPositionConstraint position_constraint_; | 649 LayerPositionConstraint position_constraint_; |
648 | 650 |
649 gfx::Vector2dF scroll_delta_; | 651 gfx::Vector2dF scroll_delta_; |
650 gfx::Vector2d sent_scroll_delta_; | 652 gfx::Vector2d sent_scroll_delta_; |
651 gfx::Vector2dF last_scroll_offset_; | 653 gfx::Vector2dF last_scroll_offset_; |
652 | 654 |
| 655 int num_descendants_that_draw_content_; |
| 656 |
653 // The global depth value of the center of the layer. This value is used | 657 // The global depth value of the center of the layer. This value is used |
654 // to sort layers from back to front. | 658 // to sort layers from back to front. |
655 float draw_depth_; | 659 float draw_depth_; |
656 | 660 |
657 FilterOperations filters_; | 661 FilterOperations filters_; |
658 FilterOperations background_filters_; | 662 FilterOperations background_filters_; |
659 | 663 |
660 protected: | 664 protected: |
661 friend class TreeSynchronizer; | 665 friend class TreeSynchronizer; |
662 | 666 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 DrawProperties<LayerImpl> draw_properties_; | 704 DrawProperties<LayerImpl> draw_properties_; |
701 | 705 |
702 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
703 | 707 |
704 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
705 }; | 709 }; |
706 | 710 |
707 } // namespace cc | 711 } // namespace cc |
708 | 712 |
709 #endif // CC_LAYERS_LAYER_IMPL_H_ | 713 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |