| Index: cc/layer_tree_host_common.h
|
| diff --git a/cc/layer_tree_host_common.h b/cc/layer_tree_host_common.h
|
| index d91eeccd59cc64b0fdb8bb2bd838684d0f15bd0d..d5db033ef1a0e2eb9413cb3f910047cbe8d7b267 100644
|
| --- a/cc/layer_tree_host_common.h
|
| +++ b/cc/layer_tree_host_common.h
|
| @@ -22,7 +22,7 @@ public:
|
| static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, const gfx::Rect& layerBoundRect, const gfx::Transform&);
|
|
|
| static void calculateDrawProperties(Layer* rootLayer, const gfx::Size& deviceViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSize, bool canUseLCDText, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList);
|
| - static void calculateDrawProperties(LayerImpl* rootLayer, const gfx::Size& deviceViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSize, bool canUseLCDText, std::vector<LayerImpl*>& renderSurfaceLayerList);
|
| + static void calculateDrawProperties(LayerImpl* rootLayer, const gfx::Size& deviceViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSize, bool canUseLCDText, std::vector<LayerImpl*>& renderSurfaceLayerList, bool updateTilePriorities);
|
|
|
| // Performs hit testing for a given renderSurfaceLayerList.
|
| static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePoint, const std::vector<LayerImpl*>& renderSurfaceLayerList);
|
| @@ -33,6 +33,8 @@ public:
|
|
|
| template<typename LayerType> static bool renderSurfaceContributesToTarget(LayerType*, int targetSurfaceLayerID);
|
|
|
| + template<class Function, typename LayerType> static void callFunctionForSubtree(LayerType* rootLayer);
|
| +
|
| // Returns a layer with the given id if one exists in the subtree starting
|
| // from the given root layer (including mask and replica layers).
|
| template<typename LayerType> static LayerType* findLayerInSubtree(LayerType* rootLayer, int layerId);
|
| @@ -94,6 +96,20 @@ LayerType* LayerTreeHostCommon::findLayerInSubtree(LayerType* rootLayer, int lay
|
| return 0;
|
| }
|
|
|
| +template<class Function, typename LayerType>
|
| +void LayerTreeHostCommon::callFunctionForSubtree(LayerType* rootLayer)
|
| +{
|
| + Function()(rootLayer);
|
| +
|
| + if (rootLayer->maskLayer())
|
| + Function()(rootLayer->maskLayer());
|
| + if (rootLayer->replicaLayer())
|
| + Function()(rootLayer->replicaLayer());
|
| +
|
| + for (size_t i = 0; i < rootLayer->children().size(); ++i)
|
| + callFunctionForSubtree<Function>(getChildAsRawPtr(rootLayer->children(), i));
|
| +}
|
| +
|
| } // namespace cc
|
|
|
| #endif // CC_LAYER_TREE_HOST_COMMON_H_
|
|
|