| Index: cc/trees/tree_synchronizer_unittest.cc
|
| diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
|
| index 417cda5077a4342c883d89fdf6c08e35196f2d4e..42b66144b02a84cf484219d0bcfa52c79db77b63 100644
|
| --- a/cc/trees/tree_synchronizer_unittest.cc
|
| +++ b/cc/trees/tree_synchronizer_unittest.cc
|
| @@ -195,6 +195,16 @@ void ExpectTreesAreIdentical(Layer* layer,
|
| }
|
| }
|
|
|
| +void PushLayerPropertiesTo(LayerTreeHost* tree_host, LayerTreeImpl* tree_impl) {
|
| + std::unordered_set<Layer*> layers_that_should_push_properties =
|
| + tree_host->LayersThatShouldPushProperties();
|
| + for (auto layer : layers_that_should_push_properties) {
|
| + LayerImpl* impl_layer = tree_impl->LayerById(layer->id());
|
| + DCHECK(impl_layer) << layer->id();
|
| + layer->PushPropertiesTo(impl_layer);
|
| + }
|
| +}
|
| +
|
| class LayerTreeSettingsForTreeSynchronizerTest : public LayerTreeSettings {
|
| public:
|
| LayerTreeSettingsForTreeSynchronizerTest() {
|
| @@ -289,8 +299,8 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeReusingLayers) {
|
| host_->active_tree());
|
|
|
| // We have to push properties to pick up the destruction list pointer.
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_->active_tree());
|
|
|
| // Add a new layer to the Layer side
|
| layer_tree_root->children()[0]->AddChild(
|
| @@ -337,8 +347,8 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeAndTrackStackingOrderChange) {
|
| host_->active_tree());
|
|
|
| // We have to push properties to pick up the destruction list pointer.
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_->active_tree());
|
|
|
| layer_impl_tree_root->ResetAllChangeTrackingForSubtree();
|
|
|
| @@ -352,8 +362,8 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeAndTrackStackingOrderChange) {
|
| layer_impl_tree_root.get(),
|
| host_->active_tree());
|
|
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_->active_tree());
|
|
|
| // Check that the impl thread properly tracked the change.
|
| EXPECT_FALSE(layer_impl_tree_root->LayerPropertyChanged());
|
| @@ -387,8 +397,8 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeAndProperties) {
|
| layer_impl_tree_root.get(),
|
| host_->active_tree());
|
|
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_->active_tree());
|
|
|
| // Check that the property values we set on the Layer tree are reflected in
|
| // the LayerImpl tree.
|
| @@ -442,8 +452,8 @@ TEST_F(TreeSynchronizerTest, ReuseLayerImplsAfterStructuralChange) {
|
| host_->active_tree());
|
|
|
| // We have to push properties to pick up the destruction list pointer.
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_->active_tree());
|
|
|
| // Now restructure the tree to look like this:
|
| // root --- D ---+--- A
|
| @@ -497,8 +507,8 @@ TEST_F(TreeSynchronizerTest, SyncSimpleTreeThenDestroy) {
|
| host_->active_tree());
|
|
|
| // We have to push properties to pick up the destruction list pointer.
|
| - TreeSynchronizer::PushProperties(old_layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(old_layer_tree_root->layer_tree_host(),
|
| + host_->active_tree());
|
|
|
| // Remove all children on the Layer side.
|
| old_layer_tree_root->RemoveAllChildren();
|
| @@ -617,8 +627,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeAnimations) {
|
| scoped_ptr<LayerImpl> layer_impl_tree_root =
|
| TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), nullptr, host_->active_tree());
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_impl->active_tree());
|
| layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), std::move(layer_impl_tree_root),
|
| host_->active_tree());
|
| @@ -652,8 +662,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) {
|
| scoped_ptr<LayerImpl> layer_impl_tree_root =
|
| TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), nullptr, host_impl->active_tree());
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_impl->active_tree());
|
| {
|
| SCOPED_TRACE("case one");
|
| ExpectTreesAreIdentical(layer_tree_root.get(),
|
| @@ -666,8 +676,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) {
|
| layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), std::move(layer_impl_tree_root),
|
| host_impl->active_tree());
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_impl->active_tree());
|
| {
|
| SCOPED_TRACE("case two");
|
| ExpectTreesAreIdentical(layer_tree_root.get(),
|
| @@ -682,8 +692,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) {
|
| layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), std::move(layer_impl_tree_root),
|
| host_impl->active_tree());
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_impl->active_tree());
|
| {
|
| SCOPED_TRACE("case three");
|
| ExpectTreesAreIdentical(layer_tree_root.get(),
|
| @@ -721,8 +731,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) {
|
| scoped_ptr<LayerImpl> layer_impl_tree_root =
|
| TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), nullptr, host_impl->active_tree());
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_impl->active_tree());
|
| ExpectTreesAreIdentical(layer_tree_root.get(),
|
| layer_impl_tree_root.get(),
|
| host_impl->active_tree());
|
| @@ -734,8 +744,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) {
|
| layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), std::move(layer_impl_tree_root),
|
| host_impl->active_tree());
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_impl->active_tree());
|
| ExpectTreesAreIdentical(layer_tree_root.get(),
|
| layer_impl_tree_root.get(),
|
| host_impl->active_tree());
|
| @@ -747,8 +757,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) {
|
| layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), std::move(layer_impl_tree_root),
|
| host_impl->active_tree());
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_impl->active_tree());
|
| ExpectTreesAreIdentical(layer_tree_root.get(),
|
| layer_impl_tree_root.get(),
|
| host_impl->active_tree());
|
| @@ -759,8 +769,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) {
|
| layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
|
| layer_tree_root.get(), std::move(layer_impl_tree_root),
|
| host_impl->active_tree());
|
| - TreeSynchronizer::PushProperties(layer_tree_root.get(),
|
| - layer_impl_tree_root.get());
|
| + PushLayerPropertiesTo(layer_tree_root->layer_tree_host(),
|
| + host_impl->active_tree());
|
| ExpectTreesAreIdentical(layer_tree_root.get(),
|
| layer_impl_tree_root.get(),
|
| host_impl->active_tree());
|
|
|