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

Unified Diff: cc/trees/layer_tree_host_common.h

Issue 15959012: cc: Make all layer recursion use CallFunctionForSubtree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DidBeginTracing changes Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.h
diff --git a/cc/trees/layer_tree_host_common.h b/cc/trees/layer_tree_host_common.h
index cecb7939b9e67239b1a220e2a076f99b842b698e..7712db215155e677169e3add78e6caf2de3b568e 100644
--- a/cc/trees/layer_tree_host_common.h
+++ b/cc/trees/layer_tree_host_common.h
@@ -64,7 +64,7 @@ class CC_EXPORT LayerTreeHostCommon {
int target_surface_layer_id);
template <class Function, typename LayerType>
- static void CallFunctionForSubtree(LayerType* root_layer);
+ static void CallFunctionForSubtree(Function function, LayerType* root_layer);
// Returns a layer with the given id if one exists in the subtree starting
// from the given root layer (including mask and replica layers).
@@ -133,21 +133,22 @@ LayerType* LayerTreeHostCommon::FindLayerInSubtree(LayerType* root_layer,
return NULL;
}
-template <class Function, typename LayerType>
-void LayerTreeHostCommon::CallFunctionForSubtree(LayerType* root_layer) {
- Function()(root_layer);
+template <typename Function, typename LayerType>
+void LayerTreeHostCommon::CallFunctionForSubtree(Function function,
+ LayerType* root_layer) {
+ function(root_layer);
if (LayerType* mask_layer = root_layer->mask_layer())
- Function()(mask_layer);
+ function(mask_layer);
if (LayerType* replica_layer = root_layer->replica_layer()) {
- Function()(replica_layer);
+ function(replica_layer);
if (LayerType* mask_layer = replica_layer->mask_layer())
- Function()(mask_layer);
+ function(mask_layer);
}
for (size_t i = 0; i < root_layer->children().size(); ++i) {
- CallFunctionForSubtree<Function>(
- get_child_as_raw_ptr(root_layer->children(), i));
+ CallFunctionForSubtree(function,
+ get_child_as_raw_ptr(root_layer->children(), i));
}
}
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698