| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <climits> | 8 #include <climits> |
| 9 | 9 |
| 10 #include "cc/animation/animation_curve.h" | 10 #include "cc/animation/animation_curve.h" |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 class LayerTreeHostAnimationTestLayerAddedWithAnimation | 483 class LayerTreeHostAnimationTestLayerAddedWithAnimation |
| 484 : public LayerTreeHostAnimationTest { | 484 : public LayerTreeHostAnimationTest { |
| 485 public: | 485 public: |
| 486 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 486 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 487 | 487 |
| 488 void DidCommit() override { | 488 void DidCommit() override { |
| 489 if (layer_tree_host()->SourceFrameNumber() == 1) { | 489 if (layer_tree_host()->SourceFrameNumber() == 1) { |
| 490 AttachPlayersToTimeline(); | 490 AttachPlayersToTimeline(); |
| 491 | 491 |
| 492 scoped_refptr<Layer> layer = Layer::Create(); | 492 scoped_refptr<Layer> layer = Layer::Create(); |
| 493 layer->SetElementId(ElementId(42, 0)); | 493 layer->SetElementId(42); |
| 494 player_->AttachElement(layer->element_id()); | 494 player_->AttachElement(layer->element_id()); |
| 495 player_->set_animation_delegate(this); | 495 player_->set_animation_delegate(this); |
| 496 | 496 |
| 497 // Any valid AnimationCurve will do here. | 497 // Any valid AnimationCurve will do here. |
| 498 std::unique_ptr<AnimationCurve> curve(new FakeFloatAnimationCurve()); | 498 std::unique_ptr<AnimationCurve> curve(new FakeFloatAnimationCurve()); |
| 499 std::unique_ptr<Animation> animation( | 499 std::unique_ptr<Animation> animation( |
| 500 Animation::Create(std::move(curve), 1, 1, TargetProperty::OPACITY)); | 500 Animation::Create(std::move(curve), 1, 1, TargetProperty::OPACITY)); |
| 501 player_->AddAnimation(std::move(animation)); | 501 player_->AddAnimation(std::move(animation)); |
| 502 | 502 |
| 503 // We add the animation *before* attaching the layer to the tree. | 503 // We add the animation *before* attaching the layer to the tree. |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 private: | 1967 private: |
| 1968 scoped_refptr<Layer> layer_; | 1968 scoped_refptr<Layer> layer_; |
| 1969 FakeContentLayerClient client_; | 1969 FakeContentLayerClient client_; |
| 1970 }; | 1970 }; |
| 1971 | 1971 |
| 1972 MULTI_THREAD_TEST_F( | 1972 MULTI_THREAD_TEST_F( |
| 1973 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); | 1973 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); |
| 1974 | 1974 |
| 1975 } // namespace | 1975 } // namespace |
| 1976 } // namespace cc | 1976 } // namespace cc |
| OLD | NEW |