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

Unified Diff: cc/test/fake_layer_tree_host.cc

Issue 1808373002: cc : Make tree synchronization independent of layer tree hierarchy (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/test/fake_layer_tree_host.cc
diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc
index 5125a7b9903628f9579bdd737bcaa81de68c999b..c1a2a10380812cc710684dc6dc5c7d47090fbee2 100644
--- a/cc/test/fake_layer_tree_host.cc
+++ b/cc/test/fake_layer_tree_host.cc
@@ -88,7 +88,12 @@ LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() {
scoped_ptr<LayerImpl> layer_impl = TreeSynchronizer::SynchronizeTrees(
root_layer(), std::move(old_root_layer_impl), active_tree());
active_tree()->SetPropertyTrees(*property_trees());
- TreeSynchronizer::PushProperties(root_layer(), layer_impl.get());
+ std::unordered_set<Layer*> layers_that_should_push_properties =
+ root_layer()->layer_tree_host()->LayersThatShouldPushProperties();
+ for (auto layer : layers_that_should_push_properties) {
+ LayerImpl* impl_layer = active_tree()->LayerById(layer->id());
+ layer->PushPropertiesTo(impl_layer);
+ }
active_tree()->SetRootLayer(std::move(layer_impl));
active_tree()->UpdatePropertyTreeScrollOffset(property_trees());
@@ -112,7 +117,12 @@ LayerImpl* FakeLayerTreeHost::CommitAndCreatePendingTree() {
scoped_ptr<LayerImpl> layer_impl = TreeSynchronizer::SynchronizeTrees(
root_layer(), std::move(old_root_layer_impl), pending_tree());
pending_tree()->SetPropertyTrees(*property_trees());
- TreeSynchronizer::PushProperties(root_layer(), layer_impl.get());
+ std::unordered_set<Layer*> layers_that_should_push_properties =
+ root_layer()->layer_tree_host()->LayersThatShouldPushProperties();
+ for (auto layer : layers_that_should_push_properties) {
+ LayerImpl* impl_layer = pending_tree()->LayerById(layer->id());
+ layer->PushPropertiesTo(impl_layer);
ajuma 2016/03/18 14:33:15 How about putting this in a method in TreeSynchron
jaydasika 2016/03/19 02:17:58 Done.
+ }
pending_tree()->SetRootLayer(std::move(layer_impl));
pending_tree()->UpdatePropertyTreeScrollOffset(property_trees());

Powered by Google App Engine
This is Rietveld 408576698