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 CC_KEYFRAMED_ANIMATION_CURVE_H_ | 5 #ifndef CC_KEYFRAMED_ANIMATION_CURVE_H_ |
6 #define CC_KEYFRAMED_ANIMATION_CURVE_H_ | 6 #define CC_KEYFRAMED_ANIMATION_CURVE_H_ |
7 | 7 |
8 #include "cc/animation_curve.h" | 8 #include "cc/animation_curve.h" |
9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
10 #include "cc/scoped_ptr_vector.h" | 10 #include "cc/scoped_ptr_vector.h" |
11 #include "cc/timing_function.h" | 11 #include "cc/timing_function.h" |
| 12 #include "cc/transform_operations.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformOperati
ons.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformOperati
ons.h" |
13 | 14 |
14 namespace cc { | 15 namespace cc { |
15 | 16 |
16 class CC_EXPORT Keyframe { | 17 class CC_EXPORT Keyframe { |
17 public: | 18 public: |
18 double time() const; | 19 double time() const; |
19 const TimingFunction* timingFunction() const; | 20 const TimingFunction* timingFunction() const; |
20 | 21 |
21 protected: | 22 protected: |
(...skipping 15 matching lines...) Expand all Loading... |
37 float value() const; | 38 float value() const; |
38 | 39 |
39 scoped_ptr<FloatKeyframe> clone() const; | 40 scoped_ptr<FloatKeyframe> clone() const; |
40 | 41 |
41 private: | 42 private: |
42 FloatKeyframe(double time, float value, scoped_ptr<TimingFunction>); | 43 FloatKeyframe(double time, float value, scoped_ptr<TimingFunction>); |
43 | 44 |
44 float m_value; | 45 float m_value; |
45 }; | 46 }; |
46 | 47 |
| 48 #if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL |
| 49 class CC_EXPORT TransformKeyframe : public Keyframe { |
| 50 public: |
| 51 static scoped_ptr<TransformKeyframe> create(double time, const TransformOper
ations& value, scoped_ptr<TimingFunction>); |
| 52 virtual ~TransformKeyframe(); |
| 53 |
| 54 const TransformOperations& value() const; |
| 55 |
| 56 scoped_ptr<TransformKeyframe> clone() const; |
| 57 |
| 58 private: |
| 59 TransformKeyframe(double time, const TransformOperations& value, scoped_ptr<
TimingFunction>); |
| 60 |
| 61 TransformOperations m_value; |
| 62 }; |
| 63 #else |
47 class CC_EXPORT TransformKeyframe : public Keyframe { | 64 class CC_EXPORT TransformKeyframe : public Keyframe { |
48 public: | 65 public: |
49 static scoped_ptr<TransformKeyframe> create(double time, const WebKit::WebTr
ansformOperations& value, scoped_ptr<TimingFunction>); | 66 static scoped_ptr<TransformKeyframe> create(double time, const WebKit::WebTr
ansformOperations& value, scoped_ptr<TimingFunction>); |
50 virtual ~TransformKeyframe(); | 67 virtual ~TransformKeyframe(); |
51 | 68 |
52 const WebKit::WebTransformOperations& value() const; | 69 const WebKit::WebTransformOperations& value() const; |
53 | 70 |
54 scoped_ptr<TransformKeyframe> clone() const; | 71 scoped_ptr<TransformKeyframe> clone() const; |
55 | 72 |
56 private: | 73 private: |
57 TransformKeyframe(double time, const WebKit::WebTransformOperations& value,
scoped_ptr<TimingFunction>); | 74 TransformKeyframe(double time, const WebKit::WebTransformOperations& value,
scoped_ptr<TimingFunction>); |
58 | 75 |
59 WebKit::WebTransformOperations m_value; | 76 WebKit::WebTransformOperations m_value; |
60 }; | 77 }; |
| 78 #endif // WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL |
61 | 79 |
62 class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve { | 80 class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve { |
63 public: | 81 public: |
64 // It is required that the keyframes be sorted by time. | 82 // It is required that the keyframes be sorted by time. |
65 static scoped_ptr<KeyframedFloatAnimationCurve> create(); | 83 static scoped_ptr<KeyframedFloatAnimationCurve> create(); |
66 | 84 |
67 virtual ~KeyframedFloatAnimationCurve(); | 85 virtual ~KeyframedFloatAnimationCurve(); |
68 | 86 |
69 void addKeyframe(scoped_ptr<FloatKeyframe>); | 87 void addKeyframe(scoped_ptr<FloatKeyframe>); |
70 | 88 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Always sorted in order of increasing time. No two keyframes have the | 125 // Always sorted in order of increasing time. No two keyframes have the |
108 // same time. | 126 // same time. |
109 ScopedPtrVector<TransformKeyframe> m_keyframes; | 127 ScopedPtrVector<TransformKeyframe> m_keyframes; |
110 | 128 |
111 DISALLOW_COPY_AND_ASSIGN(KeyframedTransformAnimationCurve); | 129 DISALLOW_COPY_AND_ASSIGN(KeyframedTransformAnimationCurve); |
112 }; | 130 }; |
113 | 131 |
114 } // namespace cc | 132 } // namespace cc |
115 | 133 |
116 #endif // CC_KEYFRAMED_ANIMATION_CURVE_H_ | 134 #endif // CC_KEYFRAMED_ANIMATION_CURVE_H_ |
OLD | NEW |