| Index: cc/layers/layer_unittest.cc
|
| diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
|
| index 1d76738aa04b59692a633d3e94212f1b614dd5a0..621a2bdc98a3ff72f7041c5fe5748cdb6306e2c7 100644
|
| --- a/cc/layers/layer_unittest.cc
|
| +++ b/cc/layers/layer_unittest.cc
|
| @@ -1046,6 +1046,20 @@ TEST_F(LayerTest, LayerPropertyChangedForSubtree) {
|
| node = layer_tree_host_->property_trees()->transform_tree.Node(
|
| root->transform_tree_index());
|
| EXPECT_TRUE(node->data.transform_changed);
|
| + EXECUTE_AND_VERIFY_SUBTREE_CHANGES_RESET(
|
| + root->PushPropertiesTo(root_impl.get());
|
| + child->PushPropertiesTo(child_impl.get());
|
| + child2->PushPropertiesTo(child2_impl.get());
|
| + grand_child->PushPropertiesTo(grand_child_impl.get());
|
| + layer_tree_host_->property_trees()->transform_tree.ResetChangeTracking());
|
| +
|
| + gfx::Transform arbitrary_transform;
|
| + arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f);
|
| + EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(1);
|
| + root->SetTransform(arbitrary_transform);
|
| + node = layer_tree_host_->property_trees()->transform_tree.Node(
|
| + root->transform_tree_index());
|
| + EXPECT_TRUE(node->data.transform_changed);
|
| }
|
|
|
| TEST_F(LayerTest, AddAndRemoveChild) {
|
| @@ -1598,58 +1612,6 @@ TEST_F(LayerTest, PushPropertiesCausesLayerPropertyChangedForOpacity) {
|
| }
|
|
|
| TEST_F(LayerTest,
|
| - PushPropsDoesntCauseLayerPropertyChangedDuringImplOnlyTransformAnim) {
|
| - scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
|
| - scoped_ptr<LayerImpl> impl_layer =
|
| - LayerImpl::Create(host_impl_.active_tree(), 1);
|
| -
|
| - EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
|
| - layer_tree_host_->SetRootLayer(test_layer));
|
| -
|
| - scoped_ptr<AnimationRegistrar> registrar;
|
| - if (settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(impl_layer->id(), timeline_impl(),
|
| - 1.0, 0, 100);
|
| - } else {
|
| - registrar = AnimationRegistrar::Create();
|
| - impl_layer->layer_animation_controller()->SetAnimationRegistrar(
|
| - registrar.get());
|
| -
|
| - AddAnimatedTransformToController(impl_layer->layer_animation_controller(),
|
| - 1.0, 0, 100);
|
| - }
|
| -
|
| - gfx::Transform transform;
|
| - transform.Rotate(45.0);
|
| - EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform(transform));
|
| -
|
| - EXPECT_FALSE(impl_layer->LayerPropertyChanged());
|
| - test_layer->PushPropertiesTo(impl_layer.get());
|
| - EXPECT_TRUE(impl_layer->LayerPropertyChanged());
|
| -
|
| - impl_layer->ResetAllChangeTrackingForSubtree();
|
| - if (settings().use_compositor_animation_timelines) {
|
| - int animation_id = AddAnimatedTransformToLayerWithPlayer(
|
| - impl_layer->id(), timeline_impl(), 1.0, 0, 100);
|
| - GetAnimationFromLayerWithExistingPlayer(impl_layer->id(), timeline_impl(),
|
| - animation_id)
|
| - ->set_is_impl_only(true);
|
| - } else {
|
| - AddAnimatedTransformToController(impl_layer->layer_animation_controller(),
|
| - 1.0, 0, 100);
|
| - impl_layer->layer_animation_controller()
|
| - ->GetAnimation(Animation::TRANSFORM)
|
| - ->set_is_impl_only(true);
|
| - }
|
| - transform.Rotate(45.0);
|
| - EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform(transform));
|
| -
|
| - EXPECT_FALSE(impl_layer->LayerPropertyChanged());
|
| - test_layer->PushPropertiesTo(impl_layer.get());
|
| - EXPECT_FALSE(impl_layer->LayerPropertyChanged());
|
| -}
|
| -
|
| -TEST_F(LayerTest,
|
| PushPropsDoesntCauseLayerPropertyChangedDuringImplOnlyOpacityAnim) {
|
| scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
|
| scoped_ptr<LayerImpl> impl_layer =
|
| @@ -2545,6 +2507,25 @@ TEST_F(LayerTest, SimplePropertiesSerialization) {
|
| layer_src_b->SetMaskLayer(layer_src_b_mask.get());
|
| layer_src_b->SetReplicaLayer(layer_src_b_replica.get());
|
|
|
| + proto::LayerUpdate layer_update_root;
|
| + // Only layers with descendants that require pushing properties will
|
| + // return true from ToLayerPropertiesProto and AddChild will change the
|
| + // stacking order of child which will make it push properties.
|
| + EXPECT_TRUE(layer_src_root->ToLayerPropertiesProto(&layer_update_root));
|
| + proto::LayerUpdate layer_update_a;
|
| + EXPECT_TRUE(layer_src_a->ToLayerPropertiesProto(&layer_update_a));
|
| + proto::LayerUpdate layer_update_b;
|
| + EXPECT_TRUE(layer_src_b->ToLayerPropertiesProto(&layer_update_b));
|
| + proto::LayerUpdate layer_update_c;
|
| + EXPECT_FALSE(layer_src_c->ToLayerPropertiesProto(&layer_update_c));
|
| + proto::LayerUpdate layer_update_d;
|
| + EXPECT_FALSE(layer_src_d->ToLayerPropertiesProto(&layer_update_d));
|
| + layer_update_root.Clear();
|
| + layer_update_a.Clear();
|
| + layer_update_b.Clear();
|
| + layer_update_c.Clear();
|
| + layer_update_d.Clear();
|
| +
|
| layer_src_a->SetNeedsPushProperties();
|
| layer_src_b->SetNeedsPushProperties();
|
| layer_src_b_mask->SetNeedsPushProperties();
|
| @@ -2552,20 +2533,15 @@ TEST_F(LayerTest, SimplePropertiesSerialization) {
|
|
|
| // Only layers with descendants that require pushing properties will
|
| // return true from ToLayerPropertiesProto.
|
| - proto::LayerUpdate layer_update_root;
|
| EXPECT_TRUE(layer_src_root->ToLayerPropertiesProto(&layer_update_root));
|
| - proto::LayerUpdate layer_update_a;
|
| EXPECT_FALSE(layer_src_a->ToLayerPropertiesProto(&layer_update_a));
|
| - proto::LayerUpdate layer_update_b;
|
| EXPECT_TRUE(layer_src_b->ToLayerPropertiesProto(&layer_update_b));
|
| proto::LayerUpdate layer_update_b_mask;
|
| EXPECT_FALSE(layer_src_b_mask->ToLayerPropertiesProto(&layer_update_b_mask));
|
| proto::LayerUpdate layer_update_b_replica;
|
| EXPECT_FALSE(
|
| layer_src_b_replica->ToLayerPropertiesProto(&layer_update_b_replica));
|
| - proto::LayerUpdate layer_update_c;
|
| EXPECT_FALSE(layer_src_c->ToLayerPropertiesProto(&layer_update_c));
|
| - proto::LayerUpdate layer_update_d;
|
| EXPECT_FALSE(layer_src_d->ToLayerPropertiesProto(&layer_update_d));
|
|
|
| // All flags for pushing properties should have been cleared.
|
|
|