| Index: ui/compositor/layer_animator.h
|
| diff --git a/ui/compositor/layer_animator.h b/ui/compositor/layer_animator.h
|
| index bf8ee7cfd49bb8207812786d570aff046e3d313b..a6fc4ef72f3f92c1d07dbefc13573ac0e41436af 100644
|
| --- a/ui/compositor/layer_animator.h
|
| +++ b/ui/compositor/layer_animator.h
|
| @@ -113,14 +113,20 @@ class COMPOSITOR_EXPORT LayerAnimator
|
| // of this animation sequence.
|
| void ScheduleAnimation(LayerAnimationSequence* animation);
|
|
|
| - // Starts the animations to be run together. Obviously will not work if
|
| - // they animate any common properties. The animator takes ownership of the
|
| + // Starts the animations to be run together, ensuring that the first elements
|
| + // in these sequences have the same effective start time even when some of
|
| + // them start on the compositor thread (but there is no such guarantee for
|
| + // the effective start time of subsequent elements). Obviously will not work
|
| + // if they animate any common properties. The animator takes ownership of the
|
| // animation sequences. Takes PreemptionStrategy into account.
|
| void StartTogether(const std::vector<LayerAnimationSequence*>& animations);
|
|
|
| - // Schedules the animations to be run together. Obviously will not work if
|
| - // they animate any common properties. The animator takes ownership of the
|
| - // animation sequences.
|
| + // Schedules the animations to be run together, ensuring that the first
|
| + // elements in these sequences have the same effective start time even when
|
| + // some of them start on the compositor thread (but there is no such guarantee
|
| + // for the effective start time of subsequent elements). Obviously will not
|
| + // work if they animate any common properties. The animator takes ownership
|
| + // of the animation sequences.
|
| void ScheduleTogether(const std::vector<LayerAnimationSequence*>& animations);
|
|
|
| // Schedules a pause for length |duration| of all the specified properties.
|
| @@ -159,6 +165,9 @@ class COMPOSITOR_EXPORT LayerAnimator
|
| void AddObserver(LayerAnimationObserver* observer);
|
| void RemoveObserver(LayerAnimationObserver* observer);
|
|
|
| + // Called when a threaded animation is actually started.
|
| + void OnThreadedAnimationStarted(const cc::AnimationEvent& event);
|
| +
|
| // This determines how implicit animations will be tweened. This has no
|
| // effect on animations that are explicitly started or scheduled. The default
|
| // is Tween::LINEAR.
|
| @@ -198,6 +207,23 @@ class COMPOSITOR_EXPORT LayerAnimator
|
| return disable_animations_for_test_;
|
| }
|
|
|
| + // Allows tests to access sequences owned by the animator.
|
| + class TestController {
|
| + public:
|
| + TestController(scoped_refptr<LayerAnimator> animator);
|
| +
|
| + ~TestController();
|
| +
|
| + LayerAnimator* animator() { return animator_.get(); }
|
| +
|
| + // Returns the running sequence animating the given property, if any.
|
| + LayerAnimationSequence* GetRunningSequence(
|
| + LayerAnimationElement::AnimatableProperty property);
|
| +
|
| + private:
|
| + scoped_refptr<LayerAnimator> animator_;
|
| + };
|
| +
|
| protected:
|
| virtual ~LayerAnimator();
|
|
|
| @@ -216,6 +242,7 @@ class COMPOSITOR_EXPORT LayerAnimator
|
| private:
|
| friend class base::RefCounted<LayerAnimator>;
|
| friend class ScopedLayerAnimationSettings;
|
| + friend class LayerAnimator::TestController;
|
|
|
| class RunningAnimation {
|
| public:
|
|
|