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

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: propertytreestuff: . 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..a3820cadf48c430da188832506f1aaff16456963 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();
}
@@ -1022,11 +1024,15 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
void LayerTreeImpl::BuildLayerListAndPropertyTreesForTesting() {
BuildLayerListForTesting();
- PropertyTreeBuilder::PreCalculateMetaInformationForTesting(
- root_layer_for_testing_);
+ BuildPropertyTreesForTesting();
+}
+
+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(
- root_layer_for_testing_, PageScaleLayer(), InnerViewportScrollLayer(),
+ layer_list_[0], PageScaleLayer(), InnerViewportScrollLayer(),
OuterViewportScrollLayer(), OverscrollElasticityLayer(),
elastic_overscroll()->Current(IsActiveTree()),
current_page_scale_factor(), device_scale_factor(),
« 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