| Index: cc/layers/layer_utils_unittest.cc
|
| diff --git a/cc/layers/layer_utils_unittest.cc b/cc/layers/layer_utils_unittest.cc
|
| index 396d02ad103228cf76d1ddaab747fac8e255ebee..6d16c5c960d0de5e7adf62bb0d3c97610aa33c6e 100644
|
| --- a/cc/layers/layer_utils_unittest.cc
|
| +++ b/cc/layers/layer_utils_unittest.cc
|
| @@ -46,11 +46,9 @@ class LayerUtilsGetAnimationBoundsTest : public testing::Test {
|
| child2_(parent2_->children()[0].get()),
|
| grand_child_(child2_->children()[0].get()),
|
| great_grand_child_(grand_child_->children()[0].get()) {
|
| - if (host_impl_.settings().use_compositor_animation_timelines) {
|
| - timeline_ =
|
| - AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
|
| - host_impl_.animation_host()->AddAnimationTimeline(timeline_);
|
| - }
|
| + timeline_ =
|
| + AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
|
| + host_impl_.animation_host()->AddAnimationTimeline(timeline_);
|
| }
|
|
|
| LayerImpl* root() { return root_; }
|
| @@ -103,12 +101,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, ScaleRoot) {
|
| start.AppendScale(1.f, 1.f, 1.f);
|
| TransformOperations end;
|
| end.AppendScale(2.f, 2.f, 1.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(root()->id(), timeline(), duration,
|
| - start, end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(root(), duration, start, end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(root()->id(), timeline(), duration,
|
| + start, end);
|
|
|
| root()->SetPosition(gfx::PointF());
|
| parent1()->SetPosition(gfx::PointF());
|
| @@ -134,12 +128,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, TranslateParentLayer) {
|
| start.AppendTranslate(0.f, 0.f, 0.f);
|
| TransformOperations end;
|
| end.AppendTranslate(50.f, 50.f, 0.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(parent1()->id(), timeline(), duration,
|
| - start, end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(parent1(), duration, start, end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(parent1()->id(), timeline(), duration,
|
| + start, end);
|
|
|
| parent1()->SetBounds(gfx::Size(350, 200));
|
|
|
| @@ -163,13 +153,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, TranslateChildLayer) {
|
| start.AppendTranslate(0.f, 0.f, 0.f);
|
| TransformOperations end;
|
| end.AppendTranslate(50.f, 50.f, 0.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| - start, end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(child1(), duration, start, end);
|
| - }
|
| -
|
| + AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| + start, end);
|
| parent1()->SetBounds(gfx::Size(350, 200));
|
|
|
| child1()->SetDrawsContent(true);
|
| @@ -192,21 +177,13 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, TranslateBothLayers) {
|
| start.AppendTranslate(0.f, 0.f, 0.f);
|
| TransformOperations child_end;
|
| child_end.AppendTranslate(50.f, 0.f, 0.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(parent1()->id(), timeline(), duration,
|
| - start, child_end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(parent1(), duration, start, child_end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(parent1()->id(), timeline(), duration,
|
| + start, child_end);
|
|
|
| TransformOperations grand_child_end;
|
| grand_child_end.AppendTranslate(0.f, 50.f, 0.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| - start, grand_child_end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(child1(), duration, start, grand_child_end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| + start, grand_child_end);
|
|
|
| parent1()->SetBounds(gfx::Size(350, 200));
|
|
|
| @@ -230,12 +207,9 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXNoPerspective) {
|
| start.AppendRotate(1.f, 0.f, 0.f, 0.f);
|
| TransformOperations end;
|
| end.AppendRotate(1.f, 0.f, 0.f, 90.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| - start, end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(child1(), duration, start, end);
|
| - }
|
| +
|
| + AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| + start, end);
|
|
|
| parent1()->SetBounds(gfx::Size(350, 200));
|
|
|
| @@ -263,12 +237,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXWithPerspective) {
|
| TransformOperations end;
|
| end.AppendRotate(1.f, 0.f, 0.f, 90.f);
|
|
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| - start, end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(child1(), duration, start, end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| + start, end);
|
|
|
| // Make the anchor point not the default 0.5 value and line up with the
|
| // child center to make the math easier.
|
| @@ -308,12 +278,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXWithPerspectiveOnSameLayer) {
|
| TransformOperations end;
|
| end.AppendRotate(1.f, 0.f, 0.f, 90.f);
|
|
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(parent1()->id(), timeline(), duration,
|
| - start, end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(parent1(), duration, start, end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(parent1()->id(), timeline(), duration,
|
| + start, end);
|
|
|
| // Make the anchor point not the default 0.5 value and line up
|
| // with the child center to make the math easier.
|
| @@ -348,12 +314,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateZ) {
|
| start.AppendRotate(0.f, 0.f, 1.f, 0.f);
|
| TransformOperations end;
|
| end.AppendRotate(0.f, 0.f, 1.f, 90.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| - start, end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(child1(), duration, start, end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| + start, end);
|
|
|
| parent1()->SetBounds(gfx::Size(350, 200));
|
|
|
| @@ -386,12 +348,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, MismatchedTransforms) {
|
| start.AppendTranslate(5, 6, 7);
|
| TransformOperations end;
|
| end.AppendRotate(0.f, 0.f, 1.f, 90.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| - start, end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(child1(), duration, start, end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(child1()->id(), timeline(), duration,
|
| + start, end);
|
|
|
| parent1()->SetBounds(gfx::Size(350, 200));
|
|
|
| @@ -425,14 +383,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest,
|
| start.AppendTranslate(0.f, 0.f, 0.f);
|
| TransformOperations great_grand_child_end;
|
| great_grand_child_end.AppendTranslate(50.f, 0.f, 0.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(grand_child()->id(), timeline(),
|
| - duration, start,
|
| - great_grand_child_end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(grand_child(), duration, start,
|
| - great_grand_child_end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(grand_child()->id(), timeline(),
|
| + duration, start, great_grand_child_end);
|
|
|
| gfx::Transform translate_2d_transform;
|
| translate_2d_transform.Translate(80.f, 60.f);
|
| @@ -459,14 +411,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest,
|
| start.AppendRotate(0.f, 0.f, 1.f, 0.f);
|
| TransformOperations great_grand_child_end;
|
| great_grand_child_end.AppendRotate(0.f, 0.f, 1.f, 90.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(grand_child()->id(), timeline(),
|
| - duration, start,
|
| - great_grand_child_end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(grand_child(), duration, start,
|
| - great_grand_child_end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(grand_child()->id(), timeline(),
|
| + duration, start, great_grand_child_end);
|
|
|
| gfx::Transform translate_2d_transform;
|
| translate_2d_transform.Translate(80.f, 60.f);
|
| @@ -512,14 +458,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest,
|
| start.AppendRotate(1.f, 0.f, 0.f, 0.f);
|
| TransformOperations great_grand_child_end;
|
| great_grand_child_end.AppendRotate(1.f, 0.f, 0.f, 90.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(great_grand_child()->id(), timeline(),
|
| - duration, start,
|
| - great_grand_child_end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(great_grand_child(), duration, start,
|
| - great_grand_child_end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(great_grand_child()->id(), timeline(),
|
| + duration, start, great_grand_child_end);
|
|
|
| gfx::Transform translate_2d_transform;
|
| translate_2d_transform.Translate(80.f, 60.f);
|
| @@ -599,13 +539,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest,
|
| start.AppendRotate(1.f, 0.f, 0.f, 0.f);
|
| TransformOperations rotate_x_end;
|
| rotate_x_end.AppendRotate(1.f, 0.f, 0.f, 90.f);
|
| - if (host_impl().settings().use_compositor_animation_timelines) {
|
| - AddAnimatedTransformToLayerWithPlayer(great_grand_child()->id(), timeline(),
|
| - duration, start, rotate_x_end);
|
| - } else {
|
| - AddAnimatedTransformToLayer(great_grand_child(), duration, start,
|
| - rotate_x_end);
|
| - }
|
| + AddAnimatedTransformToLayerWithPlayer(great_grand_child()->id(), timeline(),
|
| + duration, start, rotate_x_end);
|
|
|
| gfx::Transform translate_2d_transform;
|
| translate_2d_transform.Translate(80.f, 60.f);
|
|
|