diff options
author | vollick <vollick@chromium.org> | 2015-04-17 12:12:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-17 19:12:56 +0000 |
commit | 5057e1ee8ec082969674af4518082e9845417229 (patch) | |
tree | 50731aec702fb144d46991e10636b99664d5ec3f /cc/trees/layer_tree_host_common.h | |
parent | 31d9d612cdf6e92f57bd0445473dbc1a7d8fc205 (diff) | |
download | chromium_src-5057e1ee8ec082969674af4518082e9845417229.zip chromium_src-5057e1ee8ec082969674af4518082e9845417229.tar.gz chromium_src-5057e1ee8ec082969674af4518082e9845417229.tar.bz2 |
Reuse property trees
This patch adds a needs_rebuild boolean to PropertyTrees
and resets it each time the trees are rebuilt. Certain
layer operations do not require a rebuild and can instead
mutate an existing property tree node (e.g., updating a
scroll offset). Special care is taken in Layer to avoid
setting needs_rebuild in these cases.
BUG=470272
Review URL: https://codereview.chromium.org/1088773003
Cr-Commit-Position: refs/heads/master@{#325694}
Diffstat (limited to 'cc/trees/layer_tree_host_common.h')
-rw-r--r-- | cc/trees/layer_tree_host_common.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cc/trees/layer_tree_host_common.h b/cc/trees/layer_tree_host_common.h index 030d07a..f0378df 100644 --- a/cc/trees/layer_tree_host_common.h +++ b/cc/trees/layer_tree_host_common.h @@ -105,7 +105,7 @@ class CC_EXPORT LayerTreeHostCommon { private: const gfx::Transform identity_transform_; - PropertyTrees property_trees; + PropertyTrees temporary_property_trees; }; typedef CalcDrawPropsInputs<Layer, RenderSurfaceLayerList> @@ -233,6 +233,11 @@ void LayerTreeHostCommon::CallFunctionForSubtree(LayerType* layer, } } +CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer, + PropertyTrees* trees_from_inputs); +CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer, + PropertyTrees* trees_from_inputs); + template <typename LayerType, typename RenderSurfaceLayerListType> LayerTreeHostCommon::CalcDrawPropsInputsForTesting<LayerType, RenderSurfaceLayerListType>:: @@ -258,7 +263,7 @@ LayerTreeHostCommon::CalcDrawPropsInputsForTesting<LayerType, true, render_surface_layer_list, 0, - &property_trees) { + GetPropertyTrees(root_layer, &temporary_property_trees)) { DCHECK(root_layer); DCHECK(render_surface_layer_list); } @@ -287,7 +292,7 @@ LayerTreeHostCommon::CalcDrawPropsInputsForTesting<LayerType, true, render_surface_layer_list, 0, - &property_trees) { + GetPropertyTrees(root_layer, &temporary_property_trees)) { DCHECK(root_layer); DCHECK(render_surface_layer_list); } |