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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 LayerImpl* scroll_parent() { return scroll_parent_; } | 133 LayerImpl* scroll_parent() { return scroll_parent_; } |
134 const LayerImpl* scroll_parent() const { return scroll_parent_; } | 134 const LayerImpl* scroll_parent() const { return scroll_parent_; } |
135 | 135 |
136 void SetScrollChildren(std::set<LayerImpl*>* children); | 136 void SetScrollChildren(std::set<LayerImpl*>* children); |
137 | 137 |
138 std::set<LayerImpl*>* scroll_children() { return scroll_children_.get(); } | 138 std::set<LayerImpl*>* scroll_children() { return scroll_children_.get(); } |
139 const std::set<LayerImpl*>* scroll_children() const { | 139 const std::set<LayerImpl*>* scroll_children() const { |
140 return scroll_children_.get(); | 140 return scroll_children_.get(); |
141 } | 141 } |
142 | 142 |
| 143 void SetNumDescendantsThatDrawContent(int num_descendants); |
143 void SetClipParent(LayerImpl* ancestor); | 144 void SetClipParent(LayerImpl* ancestor); |
144 | 145 |
145 LayerImpl* clip_parent() { | 146 LayerImpl* clip_parent() { |
146 return clip_parent_; | 147 return clip_parent_; |
147 } | 148 } |
148 const LayerImpl* clip_parent() const { | 149 const LayerImpl* clip_parent() const { |
149 return clip_parent_; | 150 return clip_parent_; |
150 } | 151 } |
151 | 152 |
152 void SetClipChildren(std::set<LayerImpl*>* children); | 153 void SetClipChildren(std::set<LayerImpl*>* children); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 virtual void UpdateTiles( | 205 virtual void UpdateTiles( |
205 const OcclusionTracker<LayerImpl>* occlusion_tracker) {} | 206 const OcclusionTracker<LayerImpl>* occlusion_tracker) {} |
206 virtual void NotifyTileStateChanged(const Tile* tile) {} | 207 virtual void NotifyTileStateChanged(const Tile* tile) {} |
207 | 208 |
208 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); | 209 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); |
209 | 210 |
210 // Returns true if this layer has content to draw. | 211 // Returns true if this layer has content to draw. |
211 void SetDrawsContent(bool draws_content); | 212 void SetDrawsContent(bool draws_content); |
212 bool DrawsContent() const { return draws_content_; } | 213 bool DrawsContent() const { return draws_content_; } |
213 | 214 |
| 215 int NumDescendantsThatDrawContent() const; |
214 void SetHideLayerAndSubtree(bool hide); | 216 void SetHideLayerAndSubtree(bool hide); |
215 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } | 217 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } |
216 | 218 |
217 bool force_render_surface() const { return force_render_surface_; } | 219 bool force_render_surface() const { return force_render_surface_; } |
218 void SetForceRenderSurface(bool force) { force_render_surface_ = force; } | 220 void SetForceRenderSurface(bool force) { force_render_surface_ = force; } |
219 | 221 |
220 void SetTransformOrigin(const gfx::Point3F& transform_origin); | 222 void SetTransformOrigin(const gfx::Point3F& transform_origin); |
221 gfx::Point3F transform_origin() const { return transform_origin_; } | 223 gfx::Point3F transform_origin() const { return transform_origin_; } |
222 | 224 |
223 void SetBackgroundColor(SkColor background_color); | 225 void SetBackgroundColor(SkColor background_color); |
(...skipping 419 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 |