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 #ifndef CCLayerAnimationController_h | 5 #ifndef CCLayerAnimationController_h |
6 #define CCLayerAnimationController_h | 6 #define CCLayerAnimationController_h |
7 | 7 |
8 #include "CCAnimationEvents.h" | 8 #include "CCAnimationEvents.h" |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "cc/own_ptr_vector.h" |
12 #include "cc/scoped_ptr_vector.h" | |
13 #include <wtf/HashSet.h> | 12 #include <wtf/HashSet.h> |
| 13 #include <wtf/OwnPtr.h> |
| 14 #include <wtf/PassOwnPtr.h> |
14 | 15 |
15 namespace WebKit { | 16 namespace WebKit { |
16 class WebTransformationMatrix; | 17 class WebTransformationMatrix; |
17 } | 18 } |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 | 21 |
21 class Animation; | 22 class Animation; |
22 class IntSize; | 23 class IntSize; |
23 class KeyframeValueList; | 24 class KeyframeValueList; |
24 | 25 |
25 class CCLayerAnimationControllerClient { | 26 class CCLayerAnimationControllerClient { |
26 public: | 27 public: |
27 virtual ~CCLayerAnimationControllerClient() { } | 28 virtual ~CCLayerAnimationControllerClient() { } |
28 | 29 |
29 virtual int id() const = 0; | 30 virtual int id() const = 0; |
30 virtual void setOpacityFromAnimation(float) = 0; | 31 virtual void setOpacityFromAnimation(float) = 0; |
31 virtual float opacity() const = 0; | 32 virtual float opacity() const = 0; |
32 virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix
&) = 0; | 33 virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix
&) = 0; |
33 virtual const WebKit::WebTransformationMatrix& transform() const = 0; | 34 virtual const WebKit::WebTransformationMatrix& transform() const = 0; |
34 }; | 35 }; |
35 | 36 |
36 class CCLayerAnimationController { | 37 class CCLayerAnimationController { |
37 public: | 38 public: |
38 static scoped_ptr<CCLayerAnimationController> create(CCLayerAnimationControl
lerClient*); | 39 static PassOwnPtr<CCLayerAnimationController> create(CCLayerAnimationControl
lerClient*); |
39 | 40 |
40 virtual ~CCLayerAnimationController(); | 41 virtual ~CCLayerAnimationController(); |
41 | 42 |
42 // These methods are virtual for testing. | 43 // These methods are virtual for testing. |
43 virtual void addAnimation(scoped_ptr<CCActiveAnimation>); | 44 virtual void addAnimation(PassOwnPtr<CCActiveAnimation>); |
44 virtual void pauseAnimation(int animationId, double timeOffset); | 45 virtual void pauseAnimation(int animationId, double timeOffset); |
45 virtual void removeAnimation(int animationId); | 46 virtual void removeAnimation(int animationId); |
46 virtual void removeAnimation(int animationId, CCActiveAnimation::TargetPrope
rty); | 47 virtual void removeAnimation(int animationId, CCActiveAnimation::TargetPrope
rty); |
47 virtual void suspendAnimations(double monotonicTime); | 48 virtual void suspendAnimations(double monotonicTime); |
48 virtual void resumeAnimations(double monotonicTime); | 49 virtual void resumeAnimations(double monotonicTime); |
49 | 50 |
50 // Ensures that the list of active animations on the main thread and the imp
l thread | 51 // Ensures that the list of active animations on the main thread and the imp
l thread |
51 // are kept in sync. This function does not take ownership of the impl threa
d controller. | 52 // are kept in sync. This function does not take ownership of the impl threa
d controller. |
52 virtual void pushAnimationUpdatesTo(CCLayerAnimationController*); | 53 virtual void pushAnimationUpdatesTo(CCLayerAnimationController*); |
53 | 54 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void resolveConflicts(double monotonicTime); | 96 void resolveConflicts(double monotonicTime); |
96 void markAnimationsForDeletion(double monotonicTime, CCAnimationEventsVector
*); | 97 void markAnimationsForDeletion(double monotonicTime, CCAnimationEventsVector
*); |
97 void purgeAnimationsMarkedForDeletion(); | 98 void purgeAnimationsMarkedForDeletion(); |
98 | 99 |
99 void tickAnimations(double monotonicTime); | 100 void tickAnimations(double monotonicTime); |
100 | 101 |
101 // If this is true, we force a sync to the impl thread. | 102 // If this is true, we force a sync to the impl thread. |
102 bool m_forceSync; | 103 bool m_forceSync; |
103 | 104 |
104 CCLayerAnimationControllerClient* m_client; | 105 CCLayerAnimationControllerClient* m_client; |
105 ScopedPtrVector<CCActiveAnimation> m_activeAnimations; | 106 OwnPtrVector<CCActiveAnimation> m_activeAnimations; |
106 | 107 |
107 DISALLOW_COPY_AND_ASSIGN(CCLayerAnimationController); | 108 DISALLOW_COPY_AND_ASSIGN(CCLayerAnimationController); |
108 }; | 109 }; |
109 | 110 |
110 } // namespace cc | 111 } // namespace cc |
111 | 112 |
112 #endif // CCLayerAnimationController_h | 113 #endif // CCLayerAnimationController_h |
OLD | NEW |