| 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);
|
|
|