| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 void AddDrawableDescendants(int num); | 497 void AddDrawableDescendants(int num); |
| 498 | 498 |
| 499 void AddDependentNeedsPushProperties(); | 499 void AddDependentNeedsPushProperties(); |
| 500 void RemoveDependentNeedsPushProperties(); | 500 void RemoveDependentNeedsPushProperties(); |
| 501 bool parent_should_know_need_push_properties() const { | 501 bool parent_should_know_need_push_properties() const { |
| 502 return needs_push_properties() || descendant_needs_push_properties(); | 502 return needs_push_properties() || descendant_needs_push_properties(); |
| 503 } | 503 } |
| 504 | 504 |
| 505 bool IsPropertyChangeAllowed() const; | 505 bool IsPropertyChangeAllowed() const; |
| 506 | 506 |
| 507 // If this layer has a scroll parent, it removes |this| from its list of | |
| 508 // scroll children. | |
| 509 void RemoveFromScrollTree(); | |
| 510 | |
| 511 // If this layer has a clip parent, it removes |this| from its list of clip | |
| 512 // children. | |
| 513 void RemoveFromClipTree(); | |
| 514 | |
| 515 void reset_raster_scale_to_unknown() { raster_scale_ = 0.f; } | 507 void reset_raster_scale_to_unknown() { raster_scale_ = 0.f; } |
| 516 | 508 |
| 517 // This flag is set when the layer needs to push properties to the impl | 509 // This flag is set when the layer needs to push properties to the impl |
| 518 // side. | 510 // side. |
| 519 bool needs_push_properties_; | 511 bool needs_push_properties_; |
| 520 | 512 |
| 521 // The number of direct children or dependent layers that need to be recursed | 513 // The number of direct children or dependent layers that need to be recursed |
| 522 // to in order for them or a descendent of them to push properties to the impl | 514 // to in order for them or a descendent of them to push properties to the impl |
| 523 // side. | 515 // side. |
| 524 int num_dependents_need_push_properties_; | 516 int num_dependents_need_push_properties_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 556 |
| 565 // LayerAnimationValueObserver implementation. | 557 // LayerAnimationValueObserver implementation. |
| 566 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; | 558 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; |
| 567 virtual void OnOpacityAnimated(float opacity) OVERRIDE; | 559 virtual void OnOpacityAnimated(float opacity) OVERRIDE; |
| 568 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; | 560 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; |
| 569 virtual void OnScrollOffsetAnimated( | 561 virtual void OnScrollOffsetAnimated( |
| 570 const gfx::Vector2dF& scroll_offset) OVERRIDE; | 562 const gfx::Vector2dF& scroll_offset) OVERRIDE; |
| 571 virtual void OnAnimationWaitingForDeletion() OVERRIDE; | 563 virtual void OnAnimationWaitingForDeletion() OVERRIDE; |
| 572 virtual bool IsActive() const OVERRIDE; | 564 virtual bool IsActive() const OVERRIDE; |
| 573 | 565 |
| 566 // If this layer has a scroll parent, it removes |this| from its list of |
| 567 // scroll children. |
| 568 void RemoveFromScrollTree(); |
| 569 |
| 570 // If this layer has a clip parent, it removes |this| from its list of clip |
| 571 // children. |
| 572 void RemoveFromClipTree(); |
| 573 |
| 574 LayerList children_; | 574 LayerList children_; |
| 575 Layer* parent_; | 575 Layer* parent_; |
| 576 | 576 |
| 577 // Layer instances have a weak pointer to their LayerTreeHost. | 577 // Layer instances have a weak pointer to their LayerTreeHost. |
| 578 // This pointer value is nil when a Layer is not in a tree and is | 578 // This pointer value is nil when a Layer is not in a tree and is |
| 579 // updated via SetLayerTreeHost() if a layer moves between trees. | 579 // updated via SetLayerTreeHost() if a layer moves between trees. |
| 580 LayerTreeHost* layer_tree_host_; | 580 LayerTreeHost* layer_tree_host_; |
| 581 | 581 |
| 582 scoped_refptr<LayerAnimationController> layer_animation_controller_; | 582 scoped_refptr<LayerAnimationController> layer_animation_controller_; |
| 583 | 583 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 DrawProperties<Layer> draw_properties_; | 641 DrawProperties<Layer> draw_properties_; |
| 642 | 642 |
| 643 PaintProperties paint_properties_; | 643 PaintProperties paint_properties_; |
| 644 | 644 |
| 645 DISALLOW_COPY_AND_ASSIGN(Layer); | 645 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 646 }; | 646 }; |
| 647 | 647 |
| 648 } // namespace cc | 648 } // namespace cc |
| 649 | 649 |
| 650 #endif // CC_LAYERS_LAYER_H_ | 650 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |