Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: cc/layers/layer_impl.h

Issue 1097583002: cc: Commit property trees to the compositor thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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) { transform_tree_index_ = index; }
154 void set_clip_tree_index(int index) { clip_tree_index_ = index; }
155 void set_opacity_tree_index(int index) { opacity_tree_index_ = index; }
156 int clip_tree_index() const { return clip_tree_index_; }
157 int transform_tree_index() const { return transform_tree_index_; }
158 int opacity_tree_index() const { return opacity_tree_index_; }
159
160 void set_offset_to_transform_parent(gfx::Vector2dF offset) {
161 offset_to_transform_parent_ = offset;
162 }
163 gfx::Vector2dF offset_to_transform_parent() const {
164 return offset_to_transform_parent_;
165 }
166
167 const gfx::Rect& visible_rect_from_property_trees() const {
168 return visible_rect_from_property_trees_;
169 }
170 void set_visible_rect_from_property_trees(const gfx::Rect& rect) {
171 visible_rect_from_property_trees_ = rect;
172 }
173
174 void set_should_flatten_transform_from_property_tree(bool should_flatten) {
175 should_flatten_transform_from_property_tree_ = should_flatten;
176 }
177 bool should_flatten_transform_from_property_tree() const {
178 return should_flatten_transform_from_property_tree_;
179 }
180
181 // For compatibility with Layer.
182 bool has_render_surface() const { return render_surface(); }
183
151 void SetNumDescendantsThatDrawContent(int num_descendants); 184 void SetNumDescendantsThatDrawContent(int num_descendants);
152 void SetClipParent(LayerImpl* ancestor); 185 void SetClipParent(LayerImpl* ancestor);
153 186
154 LayerImpl* clip_parent() { 187 LayerImpl* clip_parent() {
155 return clip_parent_; 188 return clip_parent_;
156 } 189 }
157 const LayerImpl* clip_parent() const { 190 const LayerImpl* clip_parent() const {
158 return clip_parent_; 191 return clip_parent_;
159 } 192 }
160 193
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 LayerTreeImpl* layer_tree_impl_; 692 LayerTreeImpl* layer_tree_impl_;
660 693
661 // Properties dynamically changeable on active tree. 694 // Properties dynamically changeable on active tree.
662 scoped_refptr<SyncedScrollOffset> scroll_offset_; 695 scoped_refptr<SyncedScrollOffset> scroll_offset_;
663 gfx::Vector2dF bounds_delta_; 696 gfx::Vector2dF bounds_delta_;
664 697
665 // Properties synchronized from the associated Layer. 698 // Properties synchronized from the associated Layer.
666 gfx::Point3F transform_origin_; 699 gfx::Point3F transform_origin_;
667 gfx::Size bounds_; 700 gfx::Size bounds_;
668 LayerImpl* scroll_clip_layer_; 701 LayerImpl* scroll_clip_layer_;
702
703 gfx::Vector2dF offset_to_transform_parent_;
704
669 bool scrollable_ : 1; 705 bool scrollable_ : 1;
670 bool should_scroll_on_main_thread_ : 1; 706 bool should_scroll_on_main_thread_ : 1;
671 bool have_wheel_event_handlers_ : 1; 707 bool have_wheel_event_handlers_ : 1;
672 bool have_scroll_event_handlers_ : 1; 708 bool have_scroll_event_handlers_ : 1;
673 709
674 static_assert(SCROLL_BLOCKS_ON_MAX < (1 << 3), "ScrollBlocksOn too big"); 710 static_assert(SCROLL_BLOCKS_ON_MAX < (1 << 3), "ScrollBlocksOn too big");
675 ScrollBlocksOn scroll_blocks_on_ : 3; 711 ScrollBlocksOn scroll_blocks_on_ : 3;
676 712
677 bool user_scrollable_horizontal_ : 1; 713 bool user_scrollable_horizontal_ : 1;
678 bool user_scrollable_vertical_ : 1; 714 bool user_scrollable_vertical_ : 1;
679 bool stacking_order_changed_ : 1; 715 bool stacking_order_changed_ : 1;
680 // Whether the "back" of this layer should draw. 716 // Whether the "back" of this layer should draw.
681 bool double_sided_ : 1; 717 bool double_sided_ : 1;
682 bool should_flatten_transform_ : 1; 718 bool should_flatten_transform_ : 1;
719 bool should_flatten_transform_from_property_tree_ : 1;
683 720
684 // Tracks if drawing-related properties have changed since last redraw. 721 // Tracks if drawing-related properties have changed since last redraw.
685 bool layer_property_changed_ : 1; 722 bool layer_property_changed_ : 1;
686 723
687 bool masks_to_bounds_ : 1; 724 bool masks_to_bounds_ : 1;
688 bool contents_opaque_ : 1; 725 bool contents_opaque_ : 1;
689 bool is_root_for_isolated_group_ : 1; 726 bool is_root_for_isolated_group_ : 1;
690 bool use_parent_backface_visibility_ : 1; 727 bool use_parent_backface_visibility_ : 1;
691 bool draw_checkerboard_for_missing_tiles_ : 1; 728 bool draw_checkerboard_for_missing_tiles_ : 1;
692 bool draws_content_ : 1; 729 bool draws_content_ : 1;
693 bool hide_layer_and_subtree_ : 1; 730 bool hide_layer_and_subtree_ : 1;
694 731
695 // Cache transform_'s invertibility. 732 // Cache transform_'s invertibility.
696 bool transform_is_invertible_ : 1; 733 bool transform_is_invertible_ : 1;
697 734
698 // Set for the layer that other layers are fixed to. 735 // Set for the layer that other layers are fixed to.
699 bool is_container_for_fixed_position_layers_ : 1; 736 bool is_container_for_fixed_position_layers_ : 1;
737
700 Region non_fast_scrollable_region_; 738 Region non_fast_scrollable_region_;
701 Region touch_event_handler_region_; 739 Region touch_event_handler_region_;
702 SkColor background_color_; 740 SkColor background_color_;
703 741
704 float opacity_; 742 float opacity_;
705 SkXfermode::Mode blend_mode_; 743 SkXfermode::Mode blend_mode_;
706 gfx::PointF position_; 744 gfx::PointF position_;
707 gfx::Transform transform_; 745 gfx::Transform transform_;
708 746
709 LayerPositionConstraint position_constraint_; 747 LayerPositionConstraint position_constraint_;
710 748
711 gfx::Vector2dF scroll_compensation_adjustment_; 749 gfx::Vector2dF scroll_compensation_adjustment_;
712 750
713 int num_descendants_that_draw_content_; 751 int num_descendants_that_draw_content_;
714 752
753 gfx::Rect visible_rect_from_property_trees_;
754 int transform_tree_index_;
755 int opacity_tree_index_;
756 int clip_tree_index_;
757
715 // The global depth value of the center of the layer. This value is used 758 // The global depth value of the center of the layer. This value is used
716 // to sort layers from back to front. 759 // to sort layers from back to front.
717 float draw_depth_; 760 float draw_depth_;
718 761
719 FilterOperations filters_; 762 FilterOperations filters_;
720 FilterOperations background_filters_; 763 FilterOperations background_filters_;
721 764
722 protected: 765 protected:
723 friend class TreeSynchronizer; 766 friend class TreeSynchronizer;
724 767
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 809
767 std::vector<FrameTimingRequest> frame_timing_requests_; 810 std::vector<FrameTimingRequest> frame_timing_requests_;
768 bool frame_timing_requests_dirty_; 811 bool frame_timing_requests_dirty_;
769 812
770 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 813 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
771 }; 814 };
772 815
773 } // namespace cc 816 } // namespace cc
774 817
775 #endif // CC_LAYERS_LAYER_IMPL_H_ 818 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« cc/layers/layer.h ('K') | « cc/layers/layer.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698