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

Unified Diff: cc/trees/layer_tree_host_common.h

Issue 2035863003: cc: Add mask and replica layer ids to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 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/draw_property_utils.cc ('k') | cc/trees/layer_tree_host_common.cc » ('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 69a3d3b8aed6337fc6ec331c6f4f8ee39689a34c..3452044458a732d7d9ab62c09825b393ddd40d9d 100644
--- a/cc/trees/layer_tree_host_common.h
+++ b/cc/trees/layer_tree_host_common.h
@@ -159,31 +159,31 @@ struct CC_EXPORT ScrollAndScaleSet {
DISALLOW_COPY_AND_ASSIGN(ScrollAndScaleSet);
};
-template <typename LayerType, typename Function>
-static void CallFunctionForLayer(LayerType* layer, const Function& function) {
- function(layer);
-
- if (LayerType* mask_layer = layer->mask_layer())
- function(mask_layer);
- if (LayerType* replica_layer = layer->replica_layer()) {
- function(replica_layer);
- if (LayerType* mask_layer = replica_layer->mask_layer())
- function(mask_layer);
- }
-}
-
template <typename Function>
void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTreeHost* host,
const Function& function) {
- for (auto* layer : *host)
- CallFunctionForLayer(layer, function);
+ for (auto* layer : *host) {
+ function(layer);
+ if (Layer* mask_layer = layer->mask_layer())
+ function(mask_layer);
+ if (Layer* replica_layer = layer->replica_layer()) {
+ function(replica_layer);
+ if (Layer* mask_layer = replica_layer->mask_layer())
+ function(mask_layer);
+ }
+ }
}
template <typename Function>
-void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTreeImpl* host_impl,
+void LayerTreeHostCommon::CallFunctionForEveryLayer(LayerTreeImpl* tree_impl,
const Function& function) {
- for (auto* layer : *host_impl)
- CallFunctionForLayer(layer, function);
+ for (auto* layer : *tree_impl)
+ function(layer);
+
+ for (int id :
+ tree_impl->property_trees()->effect_tree.mask_replica_layer_ids()) {
+ function(tree_impl->LayerById(id));
+ }
}
CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer);
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698