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