OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 WebCompositorAnimationPlayer_h | 5 #ifndef WebCompositorAnimationPlayer_h |
6 #define WebCompositorAnimationPlayer_h | 6 #define WebCompositorAnimationPlayer_h |
7 | 7 |
8 #include "base/memory/ref_counted.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "platform/PlatformExport.h" | |
11 | |
12 namespace cc { | |
13 class AnimationPlayer; | |
14 } | |
15 | |
8 namespace blink { | 16 namespace blink { |
9 | 17 |
10 class WebCompositorAnimation; | 18 class WebCompositorAnimation; |
11 class WebCompositorAnimationDelegate; | 19 class WebCompositorAnimationDelegate; |
12 class WebLayer; | 20 class WebLayer; |
21 class WebToCCAnimationDelegateAdapter; | |
13 | 22 |
14 // A compositor representation for AnimationPlayer. | 23 // A compositor representation for AnimationPlayer. |
15 class WebCompositorAnimationPlayer { | 24 class PLATFORM_EXPORT WebCompositorAnimationPlayer { |
16 public: | 25 public: |
17 virtual ~WebCompositorAnimationPlayer() { } | 26 WebCompositorAnimationPlayer(); |
27 virtual ~WebCompositorAnimationPlayer(); | |
28 | |
29 cc::AnimationPlayer* animationPlayer() const; | |
18 | 30 |
19 // An animation delegate is notified when animations are started and | 31 // An animation delegate is notified when animations are started and |
20 // stopped. The WebCompositorAnimationPlayer does not take ownership of the delegate, and it is | 32 // stopped. The WebCompositorAnimationPlayer does not take ownership of the delegate, and it is |
21 // the responsibility of the client to reset the layer's delegate before | 33 // the responsibility of the client to reset the layer's delegate before |
22 // deleting the delegate. | 34 // deleting the delegate. |
23 virtual void setAnimationDelegate(WebCompositorAnimationDelegate*) = 0; | 35 virtual void setAnimationDelegate(WebCompositorAnimationDelegate*); |
24 | 36 |
25 virtual void attachLayer(WebLayer*) = 0; | 37 virtual void attachLayer(WebLayer*); |
26 virtual void detachLayer() = 0; | 38 virtual void detachLayer(); |
esprehn
2016/01/28 03:40:40
does this all need to be virtual still?
| |
27 virtual bool isLayerAttached() const = 0; | 39 virtual bool isLayerAttached() const; |
28 | 40 |
29 virtual void addAnimation(WebCompositorAnimation*) = 0; | 41 virtual void addAnimation(WebCompositorAnimation*); |
30 virtual void removeAnimation(int animationId) = 0; | 42 virtual void removeAnimation(int animationId); |
31 virtual void pauseAnimation(int animationId, double timeOffset) = 0; | 43 virtual void pauseAnimation(int animationId, double timeOffset); |
32 virtual void abortAnimation(int animationId) = 0; | 44 virtual void abortAnimation(int animationId); |
45 | |
46 private: | |
47 scoped_refptr<cc::AnimationPlayer> m_animationPlayer; | |
48 scoped_ptr<WebToCCAnimationDelegateAdapter> m_animationDelegateAdapter; | |
33 }; | 49 }; |
34 | 50 |
35 } // namespace blink | 51 } // namespace blink |
36 | 52 |
37 #endif // WebCompositorAnimationPlayer_h | 53 #endif // WebCompositorAnimationPlayer_h |
OLD | NEW |