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

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

Issue 2661523003: cc: Merge LayerTree into the LayerTreeHost. (Closed)
Patch Set: auto Created 3 years, 10 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/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_common.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 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_TREES_LAYER_TREE_HOST_COMMON_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_
6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ 6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 static int CalculateLayerJitter(LayerImpl* scrolling_layer); 121 static int CalculateLayerJitter(LayerImpl* scrolling_layer);
122 static void CalculateDrawPropertiesForTesting( 122 static void CalculateDrawPropertiesForTesting(
123 CalcDrawPropsMainInputsForTesting* inputs); 123 CalcDrawPropsMainInputsForTesting* inputs);
124 124
125 static void CalculateDrawProperties(CalcDrawPropsImplInputs* inputs); 125 static void CalculateDrawProperties(CalcDrawPropsImplInputs* inputs);
126 static void CalculateDrawPropertiesForTesting( 126 static void CalculateDrawPropertiesForTesting(
127 CalcDrawPropsImplInputsForTesting* inputs); 127 CalcDrawPropsImplInputsForTesting* inputs);
128 128
129 template <typename Function> 129 template <typename Function>
130 static void CallFunctionForEveryLayer(LayerTree* layer, 130 static void CallFunctionForEveryLayer(LayerTreeHost* host,
131 const Function& function); 131 const Function& function);
132 132
133 template <typename Function> 133 template <typename Function>
134 static void CallFunctionForEveryLayer(LayerTreeImpl* layer, 134 static void CallFunctionForEveryLayer(LayerTreeImpl* layer,
135 const Function& function); 135 const Function& function);
136 136
137 struct CC_EXPORT ScrollUpdateInfo { 137 struct CC_EXPORT ScrollUpdateInfo {
138 int layer_id; 138 int layer_id;
139 // TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports 139 // TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports
140 // fractional scroll offset. 140 // fractional scroll offset.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 gfx::Vector2dF elastic_overscroll_delta; 176 gfx::Vector2dF elastic_overscroll_delta;
177 float top_controls_delta; 177 float top_controls_delta;
178 std::vector<LayerTreeHostCommon::ScrollbarsUpdateInfo> scrollbars; 178 std::vector<LayerTreeHostCommon::ScrollbarsUpdateInfo> scrollbars;
179 std::vector<std::unique_ptr<SwapPromise>> swap_promises; 179 std::vector<std::unique_ptr<SwapPromise>> swap_promises;
180 180
181 private: 181 private:
182 DISALLOW_COPY_AND_ASSIGN(ScrollAndScaleSet); 182 DISALLOW_COPY_AND_ASSIGN(ScrollAndScaleSet);
183 }; 183 };
184 184
185 template <typename Function> 185 template <typename Function>
186 void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTree* host, 186 void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTreeHost* host,
187 const Function& function) { 187 const Function& function) {
188 for (auto* layer : *host) { 188 for (auto* layer : *host) {
189 function(layer); 189 function(layer);
190 if (Layer* mask_layer = layer->mask_layer()) 190 if (Layer* mask_layer = layer->mask_layer())
191 function(mask_layer); 191 function(mask_layer);
192 } 192 }
193 } 193 }
194 194
195 template <typename Function> 195 template <typename Function>
196 void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTreeImpl* tree_impl, 196 void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTreeImpl* tree_impl,
197 const Function& function) { 197 const Function& function) {
198 for (auto* layer : *tree_impl) 198 for (auto* layer : *tree_impl)
199 function(layer); 199 function(layer);
200 200
201 for (int id : tree_impl->property_trees()->effect_tree.mask_layer_ids()) { 201 for (int id : tree_impl->property_trees()->effect_tree.mask_layer_ids()) {
202 function(tree_impl->LayerById(id)); 202 function(tree_impl->LayerById(id));
203 } 203 }
204 } 204 }
205 205
206 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); 206 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer);
207 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer); 207 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer);
208 208
209 } // namespace cc 209 } // namespace cc
210 210
211 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ 211 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698