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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2106273002: cc: Change how/when we build layer list/property tress in tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698