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

Unified Diff: cc/layer_tree_host_common.h

Issue 12045086: cc: Throttle tile priority updates to once a frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
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_
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host_common.cc » ('j') | cc/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698