| 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 CCKeyframedAnimationCurve_h | 5 #ifndef CCKeyframedAnimationCurve_h |
| 6 #define CCKeyframedAnimationCurve_h | 6 #define CCKeyframedAnimationCurve_h |
| 7 | 7 |
| 8 #include "CCAnimationCurve.h" | 8 #include "CCAnimationCurve.h" |
| 9 #include "CCTimingFunction.h" | 9 #include "CCTimingFunction.h" |
| 10 #include "cc/own_ptr_vector.h" |
| 10 #include <public/WebTransformOperations.h> | 11 #include <public/WebTransformOperations.h> |
| 11 #include <wtf/OwnPtr.h> | 12 #include <wtf/OwnPtr.h> |
| 12 #include <wtf/PassOwnPtr.h> | 13 #include <wtf/PassOwnPtr.h> |
| 13 #include <wtf/Vector.h> | 14 #include <wtf/Vector.h> |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 | 17 |
| 17 class CCKeyframe { | 18 class CCKeyframe { |
| 18 public: | 19 public: |
| 19 double time() const; | 20 double time() const; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 virtual PassOwnPtr<CCAnimationCurve> clone() const OVERRIDE; | 73 virtual PassOwnPtr<CCAnimationCurve> clone() const OVERRIDE; |
| 73 | 74 |
| 74 // CCFloatAnimationCurve implementation | 75 // CCFloatAnimationCurve implementation |
| 75 virtual float getValue(double t) const OVERRIDE; | 76 virtual float getValue(double t) const OVERRIDE; |
| 76 | 77 |
| 77 private: | 78 private: |
| 78 CCKeyframedFloatAnimationCurve(); | 79 CCKeyframedFloatAnimationCurve(); |
| 79 | 80 |
| 80 // Always sorted in order of increasing time. No two keyframes have the | 81 // Always sorted in order of increasing time. No two keyframes have the |
| 81 // same time. | 82 // same time. |
| 82 Vector<OwnPtr<CCFloatKeyframe> > m_keyframes; | 83 OwnPtrVector<CCFloatKeyframe> m_keyframes; |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 class CCKeyframedTransformAnimationCurve : public CCTransformAnimationCurve { | 86 class CCKeyframedTransformAnimationCurve : public CCTransformAnimationCurve { |
| 86 public: | 87 public: |
| 87 // It is required that the keyframes be sorted by time. | 88 // It is required that the keyframes be sorted by time. |
| 88 static PassOwnPtr<CCKeyframedTransformAnimationCurve> create(); | 89 static PassOwnPtr<CCKeyframedTransformAnimationCurve> create(); |
| 89 | 90 |
| 90 virtual ~CCKeyframedTransformAnimationCurve(); | 91 virtual ~CCKeyframedTransformAnimationCurve(); |
| 91 | 92 |
| 92 void addKeyframe(PassOwnPtr<CCTransformKeyframe>); | 93 void addKeyframe(PassOwnPtr<CCTransformKeyframe>); |
| 93 | 94 |
| 94 // CCAnimationCurve implementation | 95 // CCAnimationCurve implementation |
| 95 virtual double duration() const OVERRIDE; | 96 virtual double duration() const OVERRIDE; |
| 96 virtual PassOwnPtr<CCAnimationCurve> clone() const OVERRIDE; | 97 virtual PassOwnPtr<CCAnimationCurve> clone() const OVERRIDE; |
| 97 | 98 |
| 98 // CCTransformAnimationCurve implementation | 99 // CCTransformAnimationCurve implementation |
| 99 virtual WebKit::WebTransformationMatrix getValue(double t) const OVERRIDE; | 100 virtual WebKit::WebTransformationMatrix getValue(double t) const OVERRIDE; |
| 100 | 101 |
| 101 private: | 102 private: |
| 102 CCKeyframedTransformAnimationCurve(); | 103 CCKeyframedTransformAnimationCurve(); |
| 103 | 104 |
| 104 // Always sorted in order of increasing time. No two keyframes have the | 105 // Always sorted in order of increasing time. No two keyframes have the |
| 105 // same time. | 106 // same time. |
| 106 Vector<OwnPtr<CCTransformKeyframe> > m_keyframes; | 107 OwnPtrVector<CCTransformKeyframe> m_keyframes; |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace cc | 110 } // namespace cc |
| 110 | 111 |
| 111 #endif // CCKeyframedAnimationCurve_h | 112 #endif // CCKeyframedAnimationCurve_h |
| OLD | NEW |