OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 namespace cc { | 54 namespace cc { |
55 | 55 |
56 class LayerTreeHostImpl; | 56 class LayerTreeHostImpl; |
57 class LayerTreeImpl; | 57 class LayerTreeImpl; |
58 class MicroBenchmarkImpl; | 58 class MicroBenchmarkImpl; |
59 class Occlusion; | 59 class Occlusion; |
60 template <typename LayerType> | 60 template <typename LayerType> |
61 class OcclusionTracker; | 61 class OcclusionTracker; |
| 62 class OpacityTree; |
62 class RenderPass; | 63 class RenderPass; |
63 class RenderPassId; | 64 class RenderPassId; |
64 class Renderer; | 65 class Renderer; |
65 class ScrollbarAnimationController; | 66 class ScrollbarAnimationController; |
66 class ScrollbarLayerImplBase; | 67 class ScrollbarLayerImplBase; |
67 class SimpleEnclosedRegion; | 68 class SimpleEnclosedRegion; |
68 class Tile; | 69 class Tile; |
| 70 class TransformTree; |
69 | 71 |
70 struct AppendQuadsData; | 72 struct AppendQuadsData; |
71 | 73 |
72 enum DrawMode { | 74 enum DrawMode { |
73 DRAW_MODE_NONE, | 75 DRAW_MODE_NONE, |
74 DRAW_MODE_HARDWARE, | 76 DRAW_MODE_HARDWARE, |
75 DRAW_MODE_SOFTWARE, | 77 DRAW_MODE_SOFTWARE, |
76 DRAW_MODE_RESOURCELESS_SOFTWARE | 78 DRAW_MODE_RESOURCELESS_SOFTWARE |
77 }; | 79 }; |
78 | 80 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 LayerImpl* scroll_parent() { return scroll_parent_; } | 143 LayerImpl* scroll_parent() { return scroll_parent_; } |
142 const LayerImpl* scroll_parent() const { return scroll_parent_; } | 144 const LayerImpl* scroll_parent() const { return scroll_parent_; } |
143 | 145 |
144 void SetScrollChildren(std::set<LayerImpl*>* children); | 146 void SetScrollChildren(std::set<LayerImpl*>* children); |
145 | 147 |
146 std::set<LayerImpl*>* scroll_children() { return scroll_children_.get(); } | 148 std::set<LayerImpl*>* scroll_children() { return scroll_children_.get(); } |
147 const std::set<LayerImpl*>* scroll_children() const { | 149 const std::set<LayerImpl*>* scroll_children() const { |
148 return scroll_children_.get(); | 150 return scroll_children_.get(); |
149 } | 151 } |
150 | 152 |
| 153 void set_transform_tree_index(int index) { |
| 154 transform_tree_index_ = index; |
| 155 SetNeedsPushProperties(); |
| 156 } |
| 157 void set_clip_tree_index(int index) { |
| 158 clip_tree_index_ = index; |
| 159 SetNeedsPushProperties(); |
| 160 } |
| 161 void set_opacity_tree_index(int index) { |
| 162 opacity_tree_index_ = index; |
| 163 SetNeedsPushProperties(); |
| 164 } |
| 165 int clip_tree_index() const { return clip_tree_index_; } |
| 166 int transform_tree_index() const { return transform_tree_index_; } |
| 167 int opacity_tree_index() const { return opacity_tree_index_; } |
| 168 |
| 169 void set_offset_to_transform_parent(gfx::Vector2dF offset) { |
| 170 offset_to_transform_parent_ = offset; |
| 171 SetNeedsPushProperties(); |
| 172 } |
| 173 gfx::Vector2dF offset_to_transform_parent() const { |
| 174 return offset_to_transform_parent_; |
| 175 } |
| 176 |
| 177 const gfx::Rect& visible_rect_from_property_trees() const { |
| 178 return visible_rect_from_property_trees_; |
| 179 } |
| 180 void set_visible_rect_from_property_trees(const gfx::Rect& rect) { |
| 181 visible_rect_from_property_trees_ = rect; |
| 182 } |
| 183 |
| 184 void set_should_flatten_transform_from_property_tree(bool should_flatten) { |
| 185 should_flatten_transform_from_property_tree_ = should_flatten; |
| 186 SetNeedsPushProperties(); |
| 187 } |
| 188 bool should_flatten_transform_from_property_tree() const { |
| 189 return should_flatten_transform_from_property_tree_; |
| 190 } |
| 191 |
| 192 // For compatibility with Layer. |
| 193 bool has_render_surface() const { return !!render_surface(); } |
| 194 |
151 void SetNumDescendantsThatDrawContent(int num_descendants); | 195 void SetNumDescendantsThatDrawContent(int num_descendants); |
152 void SetClipParent(LayerImpl* ancestor); | 196 void SetClipParent(LayerImpl* ancestor); |
153 | 197 |
154 LayerImpl* clip_parent() { | 198 LayerImpl* clip_parent() { |
155 return clip_parent_; | 199 return clip_parent_; |
156 } | 200 } |
157 const LayerImpl* clip_parent() const { | 201 const LayerImpl* clip_parent() const { |
158 return clip_parent_; | 202 return clip_parent_; |
159 } | 203 } |
160 | 204 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 LayerTreeImpl* layer_tree_impl_; | 703 LayerTreeImpl* layer_tree_impl_; |
660 | 704 |
661 // Properties dynamically changeable on active tree. | 705 // Properties dynamically changeable on active tree. |
662 scoped_refptr<SyncedScrollOffset> scroll_offset_; | 706 scoped_refptr<SyncedScrollOffset> scroll_offset_; |
663 gfx::Vector2dF bounds_delta_; | 707 gfx::Vector2dF bounds_delta_; |
664 | 708 |
665 // Properties synchronized from the associated Layer. | 709 // Properties synchronized from the associated Layer. |
666 gfx::Point3F transform_origin_; | 710 gfx::Point3F transform_origin_; |
667 gfx::Size bounds_; | 711 gfx::Size bounds_; |
668 LayerImpl* scroll_clip_layer_; | 712 LayerImpl* scroll_clip_layer_; |
| 713 |
| 714 gfx::Vector2dF offset_to_transform_parent_; |
| 715 |
669 bool scrollable_ : 1; | 716 bool scrollable_ : 1; |
670 bool should_scroll_on_main_thread_ : 1; | 717 bool should_scroll_on_main_thread_ : 1; |
671 bool have_wheel_event_handlers_ : 1; | 718 bool have_wheel_event_handlers_ : 1; |
672 bool have_scroll_event_handlers_ : 1; | 719 bool have_scroll_event_handlers_ : 1; |
673 | 720 |
674 static_assert(SCROLL_BLOCKS_ON_MAX < (1 << 3), "ScrollBlocksOn too big"); | 721 static_assert(SCROLL_BLOCKS_ON_MAX < (1 << 3), "ScrollBlocksOn too big"); |
675 ScrollBlocksOn scroll_blocks_on_ : 3; | 722 ScrollBlocksOn scroll_blocks_on_ : 3; |
676 | 723 |
677 bool user_scrollable_horizontal_ : 1; | 724 bool user_scrollable_horizontal_ : 1; |
678 bool user_scrollable_vertical_ : 1; | 725 bool user_scrollable_vertical_ : 1; |
679 bool stacking_order_changed_ : 1; | 726 bool stacking_order_changed_ : 1; |
680 // Whether the "back" of this layer should draw. | 727 // Whether the "back" of this layer should draw. |
681 bool double_sided_ : 1; | 728 bool double_sided_ : 1; |
682 bool should_flatten_transform_ : 1; | 729 bool should_flatten_transform_ : 1; |
| 730 bool should_flatten_transform_from_property_tree_ : 1; |
683 | 731 |
684 // Tracks if drawing-related properties have changed since last redraw. | 732 // Tracks if drawing-related properties have changed since last redraw. |
685 bool layer_property_changed_ : 1; | 733 bool layer_property_changed_ : 1; |
686 | 734 |
687 bool masks_to_bounds_ : 1; | 735 bool masks_to_bounds_ : 1; |
688 bool contents_opaque_ : 1; | 736 bool contents_opaque_ : 1; |
689 bool is_root_for_isolated_group_ : 1; | 737 bool is_root_for_isolated_group_ : 1; |
690 bool use_parent_backface_visibility_ : 1; | 738 bool use_parent_backface_visibility_ : 1; |
691 bool draw_checkerboard_for_missing_tiles_ : 1; | 739 bool draw_checkerboard_for_missing_tiles_ : 1; |
692 bool draws_content_ : 1; | 740 bool draws_content_ : 1; |
693 bool hide_layer_and_subtree_ : 1; | 741 bool hide_layer_and_subtree_ : 1; |
694 | 742 |
695 // Cache transform_'s invertibility. | 743 // Cache transform_'s invertibility. |
696 bool transform_is_invertible_ : 1; | 744 bool transform_is_invertible_ : 1; |
697 | 745 |
698 // Set for the layer that other layers are fixed to. | 746 // Set for the layer that other layers are fixed to. |
699 bool is_container_for_fixed_position_layers_ : 1; | 747 bool is_container_for_fixed_position_layers_ : 1; |
| 748 |
700 Region non_fast_scrollable_region_; | 749 Region non_fast_scrollable_region_; |
701 Region touch_event_handler_region_; | 750 Region touch_event_handler_region_; |
702 SkColor background_color_; | 751 SkColor background_color_; |
703 | 752 |
704 float opacity_; | 753 float opacity_; |
705 SkXfermode::Mode blend_mode_; | 754 SkXfermode::Mode blend_mode_; |
706 gfx::PointF position_; | 755 gfx::PointF position_; |
707 gfx::Transform transform_; | 756 gfx::Transform transform_; |
708 | 757 |
709 LayerPositionConstraint position_constraint_; | 758 LayerPositionConstraint position_constraint_; |
710 | 759 |
711 gfx::Vector2dF scroll_compensation_adjustment_; | 760 gfx::Vector2dF scroll_compensation_adjustment_; |
712 | 761 |
713 int num_descendants_that_draw_content_; | 762 int num_descendants_that_draw_content_; |
714 | 763 |
| 764 gfx::Rect visible_rect_from_property_trees_; |
| 765 int transform_tree_index_; |
| 766 int opacity_tree_index_; |
| 767 int clip_tree_index_; |
| 768 |
715 // The global depth value of the center of the layer. This value is used | 769 // The global depth value of the center of the layer. This value is used |
716 // to sort layers from back to front. | 770 // to sort layers from back to front. |
717 float draw_depth_; | 771 float draw_depth_; |
718 | 772 |
719 FilterOperations filters_; | 773 FilterOperations filters_; |
720 FilterOperations background_filters_; | 774 FilterOperations background_filters_; |
721 | 775 |
722 protected: | 776 protected: |
723 friend class TreeSynchronizer; | 777 friend class TreeSynchronizer; |
724 | 778 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 | 820 |
767 std::vector<FrameTimingRequest> frame_timing_requests_; | 821 std::vector<FrameTimingRequest> frame_timing_requests_; |
768 bool frame_timing_requests_dirty_; | 822 bool frame_timing_requests_dirty_; |
769 | 823 |
770 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 824 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
771 }; | 825 }; |
772 | 826 |
773 } // namespace cc | 827 } // namespace cc |
774 | 828 |
775 #endif // CC_LAYERS_LAYER_IMPL_H_ | 829 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |