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