OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CompositorAnimationPlayer_h |
| 6 #define CompositorAnimationPlayer_h |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/animation/animation_player.h" |
| 11 #include "platform/PlatformExport.h" |
| 12 #include "wtf/Noncopyable.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class CompositorAnimation; |
| 17 class WebCompositorAnimationDelegate; |
| 18 class WebLayer; |
| 19 class WebToCCAnimationDelegateAdapter; |
| 20 |
| 21 // A compositor representation for AnimationPlayer. |
| 22 class PLATFORM_EXPORT CompositorAnimationPlayer { |
| 23 WTF_MAKE_NONCOPYABLE(CompositorAnimationPlayer); |
| 24 public: |
| 25 CompositorAnimationPlayer(); |
| 26 ~CompositorAnimationPlayer(); |
| 27 |
| 28 cc::AnimationPlayer* animationPlayer() const; |
| 29 |
| 30 // An animation delegate is notified when animations are started and |
| 31 // stopped. The CompositorAnimationPlayer does not take ownership of the del
egate, and it is |
| 32 // the responsibility of the client to reset the layer's delegate before |
| 33 // deleting the delegate. |
| 34 void setAnimationDelegate(WebCompositorAnimationDelegate*); |
| 35 |
| 36 void attachLayer(WebLayer*); |
| 37 void detachLayer(); |
| 38 bool isLayerAttached() const; |
| 39 |
| 40 void addAnimation(CompositorAnimation*); |
| 41 void removeAnimation(int animationId); |
| 42 void pauseAnimation(int animationId, double timeOffset); |
| 43 void abortAnimation(int animationId); |
| 44 |
| 45 private: |
| 46 scoped_refptr<cc::AnimationPlayer> m_animationPlayer; |
| 47 scoped_ptr<WebToCCAnimationDelegateAdapter> m_animationDelegateAdapter; |
| 48 }; |
| 49 |
| 50 } // namespace blink |
| 51 |
| 52 #endif // CompositorAnimationPlayer_h |
OLD | NEW |