Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index 0adf8745e1a6e80207f614dd9b878cbd973c8794..412f92c31ee2d3b8a14a3bacc2b9d653b9a1eb7e 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -265,9 +265,11 @@ void LayerTreeImpl::SetRootLayerForTesting(std::unique_ptr<LayerImpl> layer) { |
if (root_layer_for_testing_ && layer.get() != root_layer_for_testing_) |
RemoveLayer(root_layer_for_testing_->id()); |
root_layer_for_testing_ = layer.get(); |
- if (layer) |
+ ClearLayerList(); |
+ if (layer) { |
AddLayer(std::move(layer)); |
- BuildLayerListForTesting(); |
+ BuildLayerListForTesting(); |
+ } |
layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
} |
@@ -1024,6 +1026,7 @@ void LayerTreeImpl::BuildLayerListAndPropertyTreesForTesting() { |
BuildLayerListForTesting(); |
PropertyTreeBuilder::PreCalculateMetaInformationForTesting( |
root_layer_for_testing_); |
+ property_trees_.needs_rebuild = true; |
property_trees_.transform_tree.set_source_to_parent_updates_allowed(true); |
PropertyTreeBuilder::BuildPropertyTrees( |
root_layer_for_testing_, PageScaleLayer(), InnerViewportScrollLayer(), |
@@ -1035,6 +1038,20 @@ void LayerTreeImpl::BuildLayerListAndPropertyTreesForTesting() { |
property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); |
} |
+void LayerTreeImpl::BuildPropertyTreesForTesting() { |
+ PropertyTreeBuilder::PreCalculateMetaInformationForTesting(layer_list_[0]); |
+ property_trees_.needs_rebuild = true; |
+ property_trees_.transform_tree.set_source_to_parent_updates_allowed(true); |
+ PropertyTreeBuilder::BuildPropertyTrees( |
+ layer_list_[0], PageScaleLayer(), InnerViewportScrollLayer(), |
+ OuterViewportScrollLayer(), OverscrollElasticityLayer(), |
+ elastic_overscroll()->Current(IsActiveTree()), |
+ current_page_scale_factor(), device_scale_factor(), |
+ gfx::Rect(DrawViewportSize()), layer_tree_host_impl_->DrawTransform(), |
+ &property_trees_); |
+ property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); |
+} |
+ |
const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { |
// If this assert triggers, then the list is dirty. |
DCHECK(!needs_update_draw_properties_); |