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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 void SetMaskLayer(Layer* mask_layer); | 135 void SetMaskLayer(Layer* mask_layer); |
136 Layer* mask_layer() { return mask_layer_.get(); } | 136 Layer* mask_layer() { return mask_layer_.get(); } |
137 const Layer* mask_layer() const { return mask_layer_.get(); } | 137 const Layer* mask_layer() const { return mask_layer_.get(); } |
138 | 138 |
139 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); | 139 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); |
140 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } | 140 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } |
141 | 141 |
142 void SetOpacity(float opacity); | 142 void SetOpacity(float opacity); |
143 float opacity() const { return opacity_; } | 143 float opacity() const { return opacity_; } |
144 float EffectiveOpacity() const; | |
145 bool OpacityIsAnimating() const; | 144 bool OpacityIsAnimating() const; |
146 bool HasPotentiallyRunningOpacityAnimation() const; | 145 bool HasPotentiallyRunningOpacityAnimation() const; |
147 virtual bool OpacityCanAnimateOnImplThread() const; | 146 virtual bool OpacityCanAnimateOnImplThread() const; |
148 | 147 |
149 void SetBlendMode(SkXfermode::Mode blend_mode); | 148 void SetBlendMode(SkXfermode::Mode blend_mode); |
150 SkXfermode::Mode blend_mode() const { return blend_mode_; } | 149 SkXfermode::Mode blend_mode() const { return blend_mode_; } |
151 | 150 |
152 void set_draw_blend_mode(SkXfermode::Mode blend_mode) { | 151 void set_draw_blend_mode(SkXfermode::Mode blend_mode) { |
153 if (draw_blend_mode_ == blend_mode) | 152 if (draw_blend_mode_ == blend_mode) |
154 return; | 153 return; |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 | 553 |
555 void SetMutableProperties(uint32_t properties); | 554 void SetMutableProperties(uint32_t properties); |
556 uint32_t mutable_properties() const { return mutable_properties_; } | 555 uint32_t mutable_properties() const { return mutable_properties_; } |
557 | 556 |
558 void set_visited(bool visited); | 557 void set_visited(bool visited); |
559 bool visited(); | 558 bool visited(); |
560 void set_layer_or_descendant_is_drawn(bool layer_or_descendant_is_drawn); | 559 void set_layer_or_descendant_is_drawn(bool layer_or_descendant_is_drawn); |
561 bool layer_or_descendant_is_drawn(); | 560 bool layer_or_descendant_is_drawn(); |
562 void set_sorted_for_recursion(bool sorted_for_recursion); | 561 void set_sorted_for_recursion(bool sorted_for_recursion); |
563 bool sorted_for_recursion(); | 562 bool sorted_for_recursion(); |
| 563 void set_is_hidden_from_property_trees(bool is_hidden) { |
| 564 if (is_hidden == is_hidden_from_property_trees_) |
| 565 return; |
| 566 is_hidden_from_property_trees_ = is_hidden; |
| 567 SetNeedsPushProperties(); |
| 568 } |
564 | 569 |
565 // LayerAnimationValueProvider implementation. | 570 // LayerAnimationValueProvider implementation. |
566 gfx::ScrollOffset ScrollOffsetForAnimation() const override; | 571 gfx::ScrollOffset ScrollOffsetForAnimation() const override; |
567 | 572 |
568 // LayerAnimationValueObserver implementation. | 573 // LayerAnimationValueObserver implementation. |
569 void OnFilterAnimated(const FilterOperations& filters) override; | 574 void OnFilterAnimated(const FilterOperations& filters) override; |
570 void OnOpacityAnimated(float opacity) override; | 575 void OnOpacityAnimated(float opacity) override; |
571 void OnTransformAnimated(const gfx::Transform& transform) override; | 576 void OnTransformAnimated(const gfx::Transform& transform) override; |
572 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override; | 577 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override; |
573 void OnAnimationWaitingForDeletion() override; | 578 void OnAnimationWaitingForDeletion() override; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 | 785 |
781 PaintProperties paint_properties_; | 786 PaintProperties paint_properties_; |
782 | 787 |
783 // These all act like draw properties, so don't need push properties. | 788 // These all act like draw properties, so don't need push properties. |
784 gfx::Rect visible_layer_rect_; | 789 gfx::Rect visible_layer_rect_; |
785 gfx::Rect clip_rect_; | 790 gfx::Rect clip_rect_; |
786 size_t num_unclipped_descendants_; | 791 size_t num_unclipped_descendants_; |
787 | 792 |
788 std::vector<FrameTimingRequest> frame_timing_requests_; | 793 std::vector<FrameTimingRequest> frame_timing_requests_; |
789 bool frame_timing_requests_dirty_; | 794 bool frame_timing_requests_dirty_; |
| 795 bool is_hidden_from_property_trees_; |
790 | 796 |
791 DISALLOW_COPY_AND_ASSIGN(Layer); | 797 DISALLOW_COPY_AND_ASSIGN(Layer); |
792 }; | 798 }; |
793 | 799 |
794 } // namespace cc | 800 } // namespace cc |
795 | 801 |
796 #endif // CC_LAYERS_LAYER_H_ | 802 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |