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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 virtual void SetOpacity(float opacity); | 125 virtual void SetOpacity(float opacity); |
126 float opacity() const { return inputs_.opacity; } | 126 float opacity() const { return inputs_.opacity; } |
127 float EffectiveOpacity() const; | 127 float EffectiveOpacity() const; |
128 virtual bool OpacityCanAnimateOnImplThread() const; | 128 virtual bool OpacityCanAnimateOnImplThread() const; |
129 | 129 |
130 virtual bool AlwaysUseActiveTreeOpacity() const; | 130 virtual bool AlwaysUseActiveTreeOpacity() const; |
131 | 131 |
132 void SetBlendMode(SkBlendMode blend_mode); | 132 void SetBlendMode(SkBlendMode blend_mode); |
133 SkBlendMode blend_mode() const { return inputs_.blend_mode; } | 133 SkBlendMode blend_mode() const { return inputs_.blend_mode; } |
134 | 134 |
135 void set_draw_blend_mode(SkBlendMode blend_mode) { | |
136 if (draw_blend_mode_ == blend_mode) | |
137 return; | |
138 draw_blend_mode_ = blend_mode; | |
139 SetNeedsPushProperties(); | |
140 } | |
141 SkBlendMode draw_blend_mode() const { return draw_blend_mode_; } | |
142 | |
143 // A layer is root for an isolated group when it and all its descendants are | 135 // A layer is root for an isolated group when it and all its descendants are |
144 // drawn over a black and fully transparent background, creating an isolated | 136 // drawn over a black and fully transparent background, creating an isolated |
145 // group. It should be used along with SetBlendMode(), in order to restrict | 137 // group. It should be used along with SetBlendMode(), in order to restrict |
146 // layers within the group to blend with layers outside this group. | 138 // layers within the group to blend with layers outside this group. |
147 void SetIsRootForIsolatedGroup(bool root); | 139 void SetIsRootForIsolatedGroup(bool root); |
148 bool is_root_for_isolated_group() const { | 140 bool is_root_for_isolated_group() const { |
149 return inputs_.is_root_for_isolated_group; | 141 return inputs_.is_root_for_isolated_group; |
150 } | 142 } |
151 | 143 |
152 void SetFilters(const FilterOperations& filters); | 144 void SetFilters(const FilterOperations& filters); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 bool should_flatten_transform_from_property_tree_ : 1; | 622 bool should_flatten_transform_from_property_tree_ : 1; |
631 bool draws_content_ : 1; | 623 bool draws_content_ : 1; |
632 bool use_local_transform_for_backface_visibility_ : 1; | 624 bool use_local_transform_for_backface_visibility_ : 1; |
633 bool should_check_backface_visibility_ : 1; | 625 bool should_check_backface_visibility_ : 1; |
634 bool force_render_surface_for_testing_ : 1; | 626 bool force_render_surface_for_testing_ : 1; |
635 bool subtree_property_changed_ : 1; | 627 bool subtree_property_changed_ : 1; |
636 bool may_contain_video_ : 1; | 628 bool may_contain_video_ : 1; |
637 bool is_scroll_clip_layer_ : 1; | 629 bool is_scroll_clip_layer_ : 1; |
638 bool needs_show_scrollbars_ : 1; | 630 bool needs_show_scrollbars_ : 1; |
639 SkColor safe_opaque_background_color_; | 631 SkColor safe_opaque_background_color_; |
640 // draw_blend_mode may be different than blend_mode_, | |
641 // when a RenderSurface re-parents the layer's blend_mode. | |
642 SkBlendMode draw_blend_mode_; | |
643 std::unique_ptr<std::set<Layer*>> scroll_children_; | 632 std::unique_ptr<std::set<Layer*>> scroll_children_; |
644 | 633 |
645 std::unique_ptr<std::set<Layer*>> clip_children_; | 634 std::unique_ptr<std::set<Layer*>> clip_children_; |
646 | 635 |
647 PaintProperties paint_properties_; | 636 PaintProperties paint_properties_; |
648 | 637 |
649 // These all act like draw properties, so don't need push properties. | 638 // These all act like draw properties, so don't need push properties. |
650 gfx::Rect visible_layer_rect_; | 639 gfx::Rect visible_layer_rect_; |
651 size_t num_unclipped_descendants_; | 640 size_t num_unclipped_descendants_; |
652 | 641 |
653 DISALLOW_COPY_AND_ASSIGN(Layer); | 642 DISALLOW_COPY_AND_ASSIGN(Layer); |
654 }; | 643 }; |
655 | 644 |
656 } // namespace cc | 645 } // namespace cc |
657 | 646 |
658 #endif // CC_LAYERS_LAYER_H_ | 647 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |