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

Side by Side Diff: cc/trees/layer_tree.h

Issue 2331983002: cc: Make LayerTreeHost a protected Layer member. (Closed)
Patch Set: settings Created 4 years, 3 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
« no previous file with comments | « cc/test/fake_layer_tree_host.h ('k') | cc/trees/layer_tree.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_TREES_LAYER_TREE_H_ 5 #ifndef CC_TREES_LAYER_TREE_H_
6 #define CC_TREES_LAYER_TREE_H_ 6 #define CC_TREES_LAYER_TREE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 float device_scale_factor() const { return inputs_.device_scale_factor; } 117 float device_scale_factor() const { return inputs_.device_scale_factor; }
118 118
119 void SetPaintedDeviceScaleFactor(float painted_device_scale_factor); 119 void SetPaintedDeviceScaleFactor(float painted_device_scale_factor);
120 120
121 // Used externally by blink for setting the PropertyTrees when 121 // Used externally by blink for setting the PropertyTrees when
122 // |settings_.use_layer_lists| is true. This is a SPV2 setting. 122 // |settings_.use_layer_lists| is true. This is a SPV2 setting.
123 PropertyTrees* property_trees() { return &property_trees_; } 123 PropertyTrees* property_trees() { return &property_trees_; }
124 124
125 void SetNeedsDisplayOnAllLayers(); 125 void SetNeedsDisplayOnAllLayers();
126 126
127 void SetNeedsCommit();
128
129 const LayerTreeSettings& GetSettings() const;
130
127 // Methods which should only be used internally in cc ------------------ 131 // Methods which should only be used internally in cc ------------------
128 void RegisterLayer(Layer* layer); 132 void RegisterLayer(Layer* layer);
129 void UnregisterLayer(Layer* layer); 133 void UnregisterLayer(Layer* layer);
130 Layer* LayerById(int id) const; 134 Layer* LayerById(int id) const;
131 135
132 bool UpdateLayers(const LayerList& update_layer_list, 136 bool UpdateLayers(const LayerList& update_layer_list,
133 bool* content_is_suitable_for_gpu); 137 bool* content_is_suitable_for_gpu);
134 bool in_paint_layer_contents() const { return in_paint_layer_contents_; } 138 bool in_paint_layer_contents() const { return in_paint_layer_contents_; }
135 139
136 void AddLayerShouldPushProperties(Layer* layer); 140 void AddLayerShouldPushProperties(Layer* layer);
(...skipping 10 matching lines...) Expand all
147 void SetPageScaleFromImplSide(float page_scale); 151 void SetPageScaleFromImplSide(float page_scale);
148 void SetElasticOverscrollFromImplSide(gfx::Vector2dF elastic_overscroll); 152 void SetElasticOverscrollFromImplSide(gfx::Vector2dF elastic_overscroll);
149 gfx::Vector2dF elastic_overscroll() const { return elastic_overscroll_; } 153 gfx::Vector2dF elastic_overscroll() const { return elastic_overscroll_; }
150 154
151 void UpdateHudLayer(bool show_hud_info); 155 void UpdateHudLayer(bool show_hud_info);
152 HeadsUpDisplayLayer* hud_layer() const { return hud_layer_.get(); } 156 HeadsUpDisplayLayer* hud_layer() const { return hud_layer_.get(); }
153 157
154 virtual void SetNeedsFullTreeSync(); 158 virtual void SetNeedsFullTreeSync();
155 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } 159 bool needs_full_tree_sync() const { return needs_full_tree_sync_; }
156 160
157 void SetNeedsCommit();
158 void SetPropertyTreesNeedRebuild(); 161 void SetPropertyTreesNeedRebuild();
159 162
160 void PushPropertiesTo(LayerTreeImpl* tree_impl); 163 void PushPropertiesTo(LayerTreeImpl* tree_impl);
161 164
162 void ToProtobuf(proto::LayerTree* proto); 165 void ToProtobuf(proto::LayerTree* proto);
163 void FromProtobuf(const proto::LayerTree& proto); 166 void FromProtobuf(const proto::LayerTree& proto);
164 167
165 AnimationHost* animation_host() const { return animation_host_.get(); } 168 AnimationHost* animation_host() const { return animation_host_.get(); }
166 169
167 Layer* LayerByElementId(ElementId element_id) const; 170 Layer* LayerByElementId(ElementId element_id) const;
168 void RegisterElement(ElementId element_id, 171 void RegisterElement(ElementId element_id,
169 ElementListType list_type, 172 ElementListType list_type,
170 Layer* layer); 173 Layer* layer);
171 void UnregisterElement(ElementId element_id, 174 void UnregisterElement(ElementId element_id,
172 ElementListType list_type, 175 ElementListType list_type,
173 Layer* layer); 176 Layer* layer);
174 void SetElementIdsForTesting(); 177 void SetElementIdsForTesting();
175 178
179 void BuildPropertyTreesForTesting();
180
176 // Layer iterators. 181 // Layer iterators.
177 LayerListIterator<Layer> begin() const; 182 LayerListIterator<Layer> begin() const;
178 LayerListIterator<Layer> end() const; 183 LayerListIterator<Layer> end() const;
179 LayerListReverseIterator<Layer> rbegin(); 184 LayerListReverseIterator<Layer> rbegin();
180 LayerListReverseIterator<Layer> rend(); 185 LayerListReverseIterator<Layer> rend();
181 // --------------------------------------------------------------------- 186 // ---------------------------------------------------------------------
182 187
183 private: 188 private:
184 friend class LayerTreeHostSerializationTest; 189 friend class LayerTreeHostSerializationTest;
185 190
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 284
280 std::unique_ptr<AnimationHost> animation_host_; 285 std::unique_ptr<AnimationHost> animation_host_;
281 LayerTreeHost* layer_tree_host_; 286 LayerTreeHost* layer_tree_host_;
282 287
283 DISALLOW_COPY_AND_ASSIGN(LayerTree); 288 DISALLOW_COPY_AND_ASSIGN(LayerTree);
284 }; 289 };
285 290
286 } // namespace cc 291 } // namespace cc
287 292
288 #endif // CC_TREES_LAYER_TREE_H_ 293 #endif // CC_TREES_LAYER_TREE_H_
OLDNEW
« no previous file with comments | « cc/test/fake_layer_tree_host.h ('k') | cc/trees/layer_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698