| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CompositorAnimationPlayer_h | 5 #ifndef CompositorAnimationPlayer_h |
| 6 #define CompositorAnimationPlayer_h | 6 #define CompositorAnimationPlayer_h |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "cc/animation/animation_delegate.h" | 9 #include "cc/animation/animation_delegate.h" |
| 10 #include "cc/animation/animation_player.h" | 10 #include "cc/animation/animation_player.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 public: | 30 public: |
| 31 static std::unique_ptr<CompositorAnimationPlayer> create() { | 31 static std::unique_ptr<CompositorAnimationPlayer> create() { |
| 32 return wrapUnique(new CompositorAnimationPlayer()); | 32 return wrapUnique(new CompositorAnimationPlayer()); |
| 33 } | 33 } |
| 34 | 34 |
| 35 ~CompositorAnimationPlayer(); | 35 ~CompositorAnimationPlayer(); |
| 36 | 36 |
| 37 cc::AnimationPlayer* ccAnimationPlayer() const; | 37 cc::AnimationPlayer* ccAnimationPlayer() const; |
| 38 | 38 |
| 39 // An animation delegate is notified when animations are started and | 39 // An animation delegate is notified when animations are started and stopped. |
| 40 // stopped. The CompositorAnimationPlayer does not take ownership of the deleg
ate, and it is | 40 // The CompositorAnimationPlayer does not take ownership of the delegate, and |
| 41 // the responsibility of the client to reset the layer's delegate before | 41 // it is the responsibility of the client to reset the layer's delegate before |
| 42 // deleting the delegate. | 42 // deleting the delegate. |
| 43 void setAnimationDelegate(CompositorAnimationDelegate*); | 43 void setAnimationDelegate(CompositorAnimationDelegate*); |
| 44 | 44 |
| 45 void attachElement(const CompositorElementId&); | 45 void attachElement(const CompositorElementId&); |
| 46 void detachElement(); | 46 void detachElement(); |
| 47 bool isElementAttached() const; | 47 bool isElementAttached() const; |
| 48 | 48 |
| 49 void addAnimation(std::unique_ptr<CompositorAnimation>); | 49 void addAnimation(std::unique_ptr<CompositorAnimation>); |
| 50 void removeAnimation(int animationId); | 50 void removeAnimation(int animationId); |
| 51 void pauseAnimation(int animationId, double timeOffset); | 51 void pauseAnimation(int animationId, double timeOffset); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 69 double animationStartTime, | 69 double animationStartTime, |
| 70 std::unique_ptr<cc::AnimationCurve>) override; | 70 std::unique_ptr<cc::AnimationCurve>) override; |
| 71 | 71 |
| 72 scoped_refptr<cc::AnimationPlayer> m_animationPlayer; | 72 scoped_refptr<cc::AnimationPlayer> m_animationPlayer; |
| 73 CompositorAnimationDelegate* m_delegate; | 73 CompositorAnimationDelegate* m_delegate; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace blink | 76 } // namespace blink |
| 77 | 77 |
| 78 #endif // CompositorAnimationPlayer_h | 78 #endif // CompositorAnimationPlayer_h |
| OLD | NEW |