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