| Index: cc/trees/layer_tree_host_impl_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
|
| index 16656d49a71678c2c5856d2cd9ba7e337bc1be9d..6debeb58f2857665473642649c2a8f0488ab4b39 100644
|
| --- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| @@ -376,10 +376,6 @@
|
| host_impl_->InnerViewportScrollLayer()->parent()->parent();
|
| inner_clip_layer->SetBounds(viewport_size);
|
| host_impl_->InnerViewportScrollLayer()->SetBounds(viewport_size);
|
| -
|
| - // Needs to happen before building property trees as the latter propagates
|
| - // these element ids to property tree nodes.
|
| - host_impl_->active_tree()->SetElementIdsForTesting();
|
| host_impl_->active_tree()->BuildLayerListAndPropertyTreesForTesting();
|
|
|
| host_impl_->SetViewportSize(viewport_size);
|
| @@ -1318,11 +1314,7 @@
|
| child->SetBounds(gfx::Size(10, 10));
|
| child->draw_properties().visible_layer_rect = gfx::Rect(10, 10);
|
| child->SetDrawsContent(true);
|
| -
|
| - host_impl_->pending_tree()->SetElementIdsForTesting();
|
| -
|
| - AddAnimatedTransformToElementWithPlayer(child->element_id(), timeline(), 10.0,
|
| - 3, 0);
|
| + AddAnimatedTransformToLayerWithPlayer(child->id(), timeline(), 10.0, 3, 0);
|
|
|
| EXPECT_FALSE(did_request_next_frame_);
|
| EXPECT_FALSE(did_request_redraw_);
|
| @@ -1373,15 +1365,13 @@
|
| child->draw_properties().visible_layer_rect = gfx::Rect(10, 10);
|
| child->SetDrawsContent(true);
|
|
|
| - host_impl_->active_tree()->SetElementIdsForTesting();
|
| -
|
| // Add a translate from 6,7 to 8,9.
|
| TransformOperations start;
|
| start.AppendTranslate(6.f, 7.f, 0.f);
|
| TransformOperations end;
|
| end.AppendTranslate(8.f, 9.f, 0.f);
|
| - AddAnimatedTransformToElementWithPlayer(child->element_id(), timeline(), 4.0,
|
| - start, end);
|
| + AddAnimatedTransformToLayerWithPlayer(child->id(), timeline(), 4.0, start,
|
| + end);
|
|
|
| base::TimeTicks now = base::TimeTicks::Now();
|
| host_impl_->WillBeginImplFrame(
|
| @@ -1438,11 +1428,7 @@
|
| child->SetBounds(gfx::Size(10, 10));
|
| child->draw_properties().visible_layer_rect = gfx::Rect(10, 10);
|
| child->SetDrawsContent(true);
|
| -
|
| - host_impl_->active_tree()->SetElementIdsForTesting();
|
| -
|
| - AddAnimatedTransformToElementWithPlayer(child->element_id(), timeline(), 10.0,
|
| - 3, 0);
|
| + AddAnimatedTransformToLayerWithPlayer(child->id(), timeline(), 10.0, 3, 0);
|
|
|
| // Set up the property trees so that UpdateDrawProperties will work in
|
| // CommitComplete below.
|
| @@ -1481,15 +1467,13 @@
|
| child->draw_properties().visible_layer_rect = gfx::Rect(10, 10);
|
| child->SetDrawsContent(true);
|
|
|
| - host_impl_->active_tree()->SetElementIdsForTesting();
|
| -
|
| // Add a translate animation.
|
| TransformOperations start;
|
| start.AppendTranslate(6.f, 7.f, 0.f);
|
| TransformOperations end;
|
| end.AppendTranslate(8.f, 9.f, 0.f);
|
| - AddAnimatedTransformToElementWithPlayer(child->element_id(), timeline(), 4.0,
|
| - start, end);
|
| + AddAnimatedTransformToLayerWithPlayer(child->id(), timeline(), 4.0, start,
|
| + end);
|
|
|
| base::TimeTicks now = base::TimeTicks::Now();
|
| host_impl_->WillBeginImplFrame(
|
| @@ -1558,8 +1542,6 @@
|
| child->draw_properties().visible_layer_rect = gfx::Rect(10, 10);
|
| child->SetDrawsContent(true);
|
|
|
| - host_impl_->active_tree()->SetElementIdsForTesting();
|
| -
|
| EXPECT_TRUE(child->was_ever_ready_since_last_transform_animation());
|
|
|
| // Add a translate from 6,7 to 8,9.
|
| @@ -1567,8 +1549,8 @@
|
| start.AppendTranslate(6.f, 7.f, 0.f);
|
| TransformOperations end;
|
| end.AppendTranslate(8.f, 9.f, 0.f);
|
| - int animation_id = AddAnimatedTransformToElementWithPlayer(
|
| - child->element_id(), timeline(), 4.0, start, end);
|
| + int animation_id = AddAnimatedTransformToLayerWithPlayer(
|
| + child->id(), timeline(), 4.0, start, end);
|
|
|
| base::TimeTicks now = base::TimeTicks::Now();
|
| host_impl_->WillBeginImplFrame(
|
| @@ -1599,8 +1581,8 @@
|
|
|
| // Remove the animation.
|
| child->set_has_missing_tiles(true);
|
| - RemoveAnimationFromElementWithExistingPlayer(child->element_id(), timeline(),
|
| - animation_id);
|
| + RemoveAnimationFromLayerWithExistingPlayer(child->id(), timeline(),
|
| + animation_id);
|
| child->draw_properties().screen_space_transform_is_animating = false;
|
|
|
| // Child layer doesn't have an animation, but was never ready since the last
|
| @@ -3612,11 +3594,8 @@
|
| : DidDrawCheckLayer(tree_impl, id),
|
| tile_missing_(tile_missing),
|
| had_incomplete_tile_(had_incomplete_tile) {
|
| - if (animating) {
|
| - this->SetElementId(LayerIdToElementIdForTesting(id));
|
| - AddAnimatedTransformToElementWithPlayer(this->element_id(), timeline,
|
| - 10.0, 3, 0);
|
| - }
|
| + if (animating)
|
| + AddAnimatedTransformToLayerWithPlayer(this->id(), timeline, 10.0, 3, 0);
|
| }
|
|
|
| bool tile_missing_;
|
| @@ -9782,7 +9761,7 @@
|
| host_impl_->UpdateAnimationState(true);
|
|
|
| EXPECT_TRUE(host_impl_->animation_host()->HasAnyAnimationTargetingProperty(
|
| - scrolling_layer->element_id(), TargetProperty::SCROLL_OFFSET));
|
| + scrolling_layer->id(), TargetProperty::SCROLL_OFFSET));
|
|
|
| EXPECT_EQ(gfx::ScrollOffset(), scrolling_layer->CurrentScrollOffset());
|
| host_impl_->DidFinishImplFrame();
|
| @@ -9815,7 +9794,7 @@
|
| // The instant scroll should have marked the smooth scroll animation as
|
| // aborted.
|
| EXPECT_FALSE(host_impl_->animation_host()->HasActiveAnimationForTesting(
|
| - scrolling_layer->element_id()));
|
| + scrolling_layer->id()));
|
|
|
| EXPECT_VECTOR2DF_EQ(gfx::ScrollOffset(0, y + 50),
|
| scrolling_layer->CurrentScrollOffset());
|
| @@ -9853,7 +9832,7 @@
|
| host_impl_->UpdateAnimationState(true);
|
|
|
| EXPECT_TRUE(host_impl_->animation_host()->HasAnyAnimationTargetingProperty(
|
| - scrolling_layer->element_id(), TargetProperty::SCROLL_OFFSET));
|
| + scrolling_layer->id(), TargetProperty::SCROLL_OFFSET));
|
|
|
| EXPECT_EQ(gfx::ScrollOffset(), scrolling_layer->CurrentScrollOffset());
|
| host_impl_->DidFinishImplFrame();
|
| @@ -9874,7 +9853,7 @@
|
| // Aborting with the needs completion param should have marked the smooth
|
| // scroll animation as finished.
|
| EXPECT_FALSE(host_impl_->animation_host()->HasActiveAnimationForTesting(
|
| - scrolling_layer->element_id()));
|
| + scrolling_layer->id()));
|
| EXPECT_TRUE(y > 1 && y < 49);
|
| EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer());
|
| host_impl_->DidFinishImplFrame();
|
| @@ -9963,7 +9942,6 @@
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(
|
| page_scale_factor, min_page_scale, max_page_scale);
|
| host_impl_->active_tree()->SetPageScaleOnActiveTree(page_scale_factor);
|
| - host_impl_->active_tree()->BuildLayerListAndPropertyTreesForTesting();
|
|
|
| // Scroll by a small amount, there should be no bubbling to the outer
|
| // viewport.
|
|
|