| Index: cc/trees/layer_tree_host_unittest_animation.cc
|
| diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
|
| index e1977a44fc63a23270e34c4caf87f68e55e99157..aee33bb09abf7a11a824d88b2484375116fc9997 100644
|
| --- a/cc/trees/layer_tree_host_unittest_animation.cc
|
| +++ b/cc/trees/layer_tree_host_unittest_animation.cc
|
| @@ -45,7 +45,7 @@ class LayerTreeHostAnimationTest : public LayerTreeTest {
|
|
|
| void AttachPlayersToTimeline() {
|
| animation_host()->AddAnimationTimeline(timeline_.get());
|
| - layer_tree()->SetElementIdsForTesting();
|
| + layer_tree_host()->SetElementIdsForTesting();
|
| timeline_->AttachPlayer(player_.get());
|
| timeline_->AttachPlayer(player_child_.get());
|
| }
|
| @@ -166,7 +166,7 @@ class LayerTreeHostAnimationTestAddAnimation
|
|
|
| void BeginTest() override {
|
| AttachPlayersToTimeline();
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| PostAddInstantAnimationToMainThreadPlayer(player_.get());
|
| }
|
|
|
| @@ -206,7 +206,7 @@ class LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws
|
|
|
| void BeginTest() override {
|
| AttachPlayersToTimeline();
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| PostAddAnimationToMainThreadPlayer(player_.get());
|
| }
|
|
|
| @@ -244,7 +244,7 @@ class LayerTreeHostAnimationTestAnimationsGetDeleted
|
|
|
| void BeginTest() override {
|
| AttachPlayersToTimeline();
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| PostAddAnimationToMainThreadPlayer(player_.get());
|
| }
|
|
|
| @@ -286,7 +286,7 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction
|
| picture_ = FakePictureLayer::Create(&client_);
|
| picture_->SetBounds(gfx::Size(4, 4));
|
| client_.set_bounds(picture_->bounds());
|
| - layer_tree()->root_layer()->AddChild(picture_);
|
| + layer_tree_host()->root_layer()->AddChild(picture_);
|
|
|
| AttachPlayersToTimeline();
|
| player_child_->AttachElement(picture_->element_id());
|
| @@ -350,7 +350,7 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
|
| picture_->SetBounds(gfx::Size(4, 4));
|
| client_.set_bounds(picture_->bounds());
|
|
|
| - layer_tree()->root_layer()->AddChild(picture_);
|
| + layer_tree_host()->root_layer()->AddChild(picture_);
|
|
|
| AttachPlayersToTimeline();
|
| player_child_->set_animation_delegate(this);
|
| @@ -406,7 +406,7 @@ class LayerTreeHostAnimationTestAnimationFinishedEvents
|
| public:
|
| void BeginTest() override {
|
| AttachPlayersToTimeline();
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| PostAddInstantAnimationToMainThreadPlayer(player_.get());
|
| }
|
|
|
| @@ -436,7 +436,7 @@ class LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity
|
| void SetupTree() override {
|
| update_check_layer_ = FakePictureLayer::Create(&client_);
|
| update_check_layer_->SetOpacity(0.f);
|
| - layer_tree()->SetRootLayer(update_check_layer_);
|
| + layer_tree_host()->SetRootLayer(update_check_layer_);
|
| client_.set_bounds(update_check_layer_->bounds());
|
| LayerTreeHostAnimationTest::SetupTree();
|
|
|
| @@ -500,7 +500,7 @@ class LayerTreeHostAnimationTestLayerAddedWithAnimation
|
| player_->AddAnimation(std::move(animation));
|
|
|
| // We add the animation *before* attaching the layer to the tree.
|
| - layer_tree()->root_layer()->AddChild(layer);
|
| + layer_tree_host()->root_layer()->AddChild(layer);
|
| }
|
| }
|
|
|
| @@ -638,7 +638,7 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations
|
| picture_ = FakePictureLayer::Create(&client_);
|
| picture_->SetBounds(gfx::Size(4, 4));
|
| client_.set_bounds(picture_->bounds());
|
| - layer_tree()->root_layer()->AddChild(picture_);
|
| + layer_tree_host()->root_layer()->AddChild(picture_);
|
|
|
| AttachPlayersToTimeline();
|
| player_child_->AttachElement(picture_->element_id());
|
| @@ -723,11 +723,11 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated
|
| LayerTreeHostAnimationTest::SetupTree();
|
|
|
| scroll_layer_ = FakePictureLayer::Create(&client_);
|
| - scroll_layer_->SetScrollClipLayerId(layer_tree()->root_layer()->id());
|
| + scroll_layer_->SetScrollClipLayerId(layer_tree_host()->root_layer()->id());
|
| scroll_layer_->SetBounds(gfx::Size(1000, 1000));
|
| client_.set_bounds(scroll_layer_->bounds());
|
| scroll_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20));
|
| - layer_tree()->root_layer()->AddChild(scroll_layer_);
|
| + layer_tree_host()->root_layer()->AddChild(scroll_layer_);
|
|
|
| AttachPlayersToTimeline();
|
| player_child_->AttachElement(scroll_layer_->element_id());
|
| @@ -784,8 +784,8 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationTakeover
|
| scroll_layer_->SetBounds(gfx::Size(10000, 10000));
|
| client_.set_bounds(scroll_layer_->bounds());
|
| scroll_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20));
|
| - scroll_layer_->SetScrollClipLayerId(layer_tree()->root_layer()->id());
|
| - layer_tree()->root_layer()->AddChild(scroll_layer_);
|
| + scroll_layer_->SetScrollClipLayerId(layer_tree_host()->root_layer()->id());
|
| + layer_tree_host()->root_layer()->AddChild(scroll_layer_);
|
|
|
| AttachPlayersToTimeline();
|
| player_child_->AttachElement(scroll_layer_->element_id());
|
| @@ -844,8 +844,8 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted
|
| scroll_layer_->SetBounds(gfx::Size(10000, 10000));
|
| client_.set_bounds(scroll_layer_->bounds());
|
| scroll_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20));
|
| - scroll_layer_->SetScrollClipLayerId(layer_tree()->root_layer()->id());
|
| - layer_tree()->root_layer()->AddChild(scroll_layer_);
|
| + scroll_layer_->SetScrollClipLayerId(layer_tree_host()->root_layer()->id());
|
| + layer_tree_host()->root_layer()->AddChild(scroll_layer_);
|
|
|
| AttachPlayersToTimeline();
|
| }
|
| @@ -951,11 +951,11 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationRemoval
|
| LayerTreeHostAnimationTest::SetupTree();
|
|
|
| scroll_layer_ = FakePictureLayer::Create(&client_);
|
| - scroll_layer_->SetScrollClipLayerId(layer_tree()->root_layer()->id());
|
| + scroll_layer_->SetScrollClipLayerId(layer_tree_host()->root_layer()->id());
|
| scroll_layer_->SetBounds(gfx::Size(10000, 10000));
|
| client_.set_bounds(scroll_layer_->bounds());
|
| scroll_layer_->SetScrollOffset(gfx::ScrollOffset(100.0, 200.0));
|
| - layer_tree()->root_layer()->AddChild(scroll_layer_);
|
| + layer_tree_host()->root_layer()->AddChild(scroll_layer_);
|
|
|
| std::unique_ptr<ScrollOffsetAnimationCurve> curve(
|
| ScrollOffsetAnimationCurve::Create(
|
| @@ -1074,15 +1074,15 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers
|
|
|
| void DidCommit() override {
|
| if (layer_tree_host()->SourceFrameNumber() == 1) {
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| AddAnimatedTransformToPlayer(player_.get(), 4, 1, 1);
|
| } else if (layer_tree_host()->SourceFrameNumber() == 2) {
|
| AddOpacityTransitionToPlayer(player_.get(), 1, 0.f, 0.5f, true);
|
|
|
| scoped_refptr<Layer> layer = Layer::Create();
|
| - layer_tree()->root_layer()->AddChild(layer);
|
| + layer_tree_host()->root_layer()->AddChild(layer);
|
|
|
| - layer_tree()->SetElementIdsForTesting();
|
| + layer_tree_host()->SetElementIdsForTesting();
|
| layer->SetBounds(gfx::Size(4, 4));
|
|
|
| player_child_->AttachElement(layer->element_id());
|
| @@ -1169,8 +1169,8 @@ class LayerTreeHostAnimationTestPendingTreeAnimatesFirstCommit
|
| start_transform.Translate(4.0, 4.0);
|
| layer_->SetTransform(start_transform);
|
|
|
| - layer_tree()->root_layer()->AddChild(layer_);
|
| - layer_tree()->SetElementIdsForTesting();
|
| + layer_tree_host()->root_layer()->AddChild(layer_);
|
| + layer_tree_host()->SetElementIdsForTesting();
|
|
|
| player_->AttachElement(layer_->element_id());
|
|
|
| @@ -1238,9 +1238,9 @@ class LayerTreeHostAnimationTestAnimatedLayerRemovedAndAdded
|
| LayerTreeHostAnimationTest::SetupTree();
|
| layer_ = Layer::Create();
|
| layer_->SetBounds(gfx::Size(4, 4));
|
| - layer_tree()->root_layer()->AddChild(layer_);
|
| + layer_tree_host()->root_layer()->AddChild(layer_);
|
|
|
| - layer_tree()->SetElementIdsForTesting();
|
| + layer_tree_host()->SetElementIdsForTesting();
|
|
|
| animation_host()->AddAnimationTimeline(timeline_.get());
|
| timeline_->AttachPlayer(player_.get());
|
| @@ -1270,7 +1270,7 @@ class LayerTreeHostAnimationTestAnimatedLayerRemovedAndAdded
|
| EXPECT_FALSE(animation_host()->NeedsTickAnimations());
|
| break;
|
| case 2:
|
| - layer_tree()->root_layer()->AddChild(layer_);
|
| + layer_tree_host()->root_layer()->AddChild(layer_);
|
| EXPECT_TRUE(
|
| player_->element_animations()->has_element_in_active_list());
|
| EXPECT_FALSE(
|
| @@ -1322,11 +1322,11 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating
|
| LayerTreeHostAnimationTest::SetupTree();
|
| layer_ = Layer::Create();
|
| layer_->SetBounds(gfx::Size(4, 4));
|
| - layer_tree()->root_layer()->AddChild(layer_);
|
| + layer_tree_host()->root_layer()->AddChild(layer_);
|
|
|
| AttachPlayersToTimeline();
|
|
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| player_child_->AttachElement(layer_->element_id());
|
| }
|
|
|
| @@ -1396,11 +1396,11 @@ class LayerTreeHostAnimationTestRemoveAnimation
|
| layer_ = FakePictureLayer::Create(&client_);
|
| layer_->SetBounds(gfx::Size(4, 4));
|
| client_.set_bounds(layer_->bounds());
|
| - layer_tree()->root_layer()->AddChild(layer_);
|
| + layer_tree_host()->root_layer()->AddChild(layer_);
|
|
|
| AttachPlayersToTimeline();
|
|
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| player_child_->AttachElement(layer_->element_id());
|
| }
|
|
|
| @@ -1476,7 +1476,7 @@ class LayerTreeHostAnimationTestIsAnimating
|
| layer_ = FakePictureLayer::Create(&client_);
|
| layer_->SetBounds(gfx::Size(4, 4));
|
| client_.set_bounds(layer_->bounds());
|
| - layer_tree()->root_layer()->AddChild(layer_);
|
| + layer_tree_host()->root_layer()->AddChild(layer_);
|
|
|
| AttachPlayersToTimeline();
|
| player_->AttachElement(layer_->element_id());
|
| @@ -1556,11 +1556,11 @@ class LayerTreeHostAnimationTestAnimationFinishesDuringCommit
|
| layer_ = FakePictureLayer::Create(&client_);
|
| layer_->SetBounds(gfx::Size(4, 4));
|
| client_.set_bounds(layer_->bounds());
|
| - layer_tree()->root_layer()->AddChild(layer_);
|
| + layer_tree_host()->root_layer()->AddChild(layer_);
|
|
|
| AttachPlayersToTimeline();
|
|
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| player_child_->AttachElement(layer_->element_id());
|
| }
|
|
|
| @@ -1632,7 +1632,7 @@ class LayerTreeHostAnimationTestNotifyAnimationFinished
|
| picture_ = FakePictureLayer::Create(&client_);
|
| picture_->SetBounds(gfx::Size(4, 4));
|
| client_.set_bounds(picture_->bounds());
|
| - layer_tree()->root_layer()->AddChild(picture_);
|
| + layer_tree_host()->root_layer()->AddChild(picture_);
|
|
|
| AttachPlayersToTimeline();
|
| player_->AttachElement(picture_->element_id());
|
| @@ -1683,7 +1683,7 @@ class LayerTreeHostAnimationTestChangeAnimationPlayer
|
| LayerTreeHostAnimationTest::SetupTree();
|
| AttachPlayersToTimeline();
|
| timeline_->DetachPlayer(player_child_.get());
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
|
|
| TransformOperations start;
|
| start.AppendTranslate(5.f, 5.f, 0.f);
|
| @@ -1720,7 +1720,8 @@ class LayerTreeHostAnimationTestChangeAnimationPlayer
|
| timeline_->DetachPlayer(player_.get());
|
| player_ = nullptr;
|
| timeline_->AttachPlayer(player_child_.get());
|
| - player_child_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_child_->AttachElement(
|
| + layer_tree_host()->root_layer()->element_id());
|
| AddAnimatedTransformToPlayer(player_child_.get(), 1.0, 10, 10);
|
| Animation* animation =
|
| player_child_->GetAnimation(TargetProperty::TRANSFORM);
|
| @@ -1746,7 +1747,7 @@ class LayerTreeHostAnimationTestSetPotentiallyAnimatingOnLacDestruction
|
|
|
| LayerTreeHostAnimationTest::SetupTree();
|
| AttachPlayersToTimeline();
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| AddAnimatedTransformToPlayer(player_.get(), 1.0, 5, 5);
|
| }
|
|
|
| @@ -1826,11 +1827,11 @@ class LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit
|
| layer_ = FakePictureLayer::Create(&client_);
|
| layer_->SetBounds(gfx::Size(4, 4));
|
| client_.set_bounds(layer_->bounds());
|
| - layer_tree()->root_layer()->AddChild(layer_);
|
| + layer_tree_host()->root_layer()->AddChild(layer_);
|
|
|
| AttachPlayersToTimeline();
|
|
|
| - player_->AttachElement(layer_tree()->root_layer()->element_id());
|
| + player_->AttachElement(layer_tree_host()->root_layer()->element_id());
|
| player_child_->AttachElement(layer_->element_id());
|
| }
|
|
|
| @@ -1844,11 +1845,11 @@ class LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit
|
|
|
| void UpdateLayerTreeHost() override {
|
| if (layer_tree_host()->SourceFrameNumber() == 1) {
|
| - EXPECT_FALSE(layer_tree()->property_trees()->needs_rebuild);
|
| + EXPECT_FALSE(layer_tree_host()->property_trees()->needs_rebuild);
|
| AddAnimatedTransformToPlayer(player_child_.get(), 1.0, 5, 5);
|
| }
|
|
|
| - EXPECT_TRUE(layer_tree()->property_trees()->needs_rebuild);
|
| + EXPECT_TRUE(layer_tree_host()->property_trees()->needs_rebuild);
|
| }
|
|
|
| void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
|
|
|