| 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_ANIMATION_KEYFRAMED_ANIMATION_CURVE_H_ | 5 #ifndef CC_ANIMATION_KEYFRAMED_ANIMATION_CURVE_H_ |
| 6 #define CC_ANIMATION_KEYFRAMED_ANIMATION_CURVE_H_ | 6 #define CC_ANIMATION_KEYFRAMED_ANIMATION_CURVE_H_ |
| 7 | 7 |
| 8 #include "cc/animation/animation_curve.h" | 8 #include "cc/animation/animation_curve.h" |
| 9 #include "cc/animation/timing_function.h" | 9 #include "cc/animation/timing_function.h" |
| 10 #include "cc/animation/transform_operations.h" | 10 #include "cc/animation/transform_operations.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 static scoped_ptr<KeyframedColorAnimationCurve> Create(); | 119 static scoped_ptr<KeyframedColorAnimationCurve> Create(); |
| 120 | 120 |
| 121 virtual ~KeyframedColorAnimationCurve(); | 121 virtual ~KeyframedColorAnimationCurve(); |
| 122 | 122 |
| 123 void AddKeyframe(scoped_ptr<ColorKeyframe> keyframe); | 123 void AddKeyframe(scoped_ptr<ColorKeyframe> keyframe); |
| 124 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { | 124 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { |
| 125 timing_function_ = timing_function.Pass(); | 125 timing_function_ = timing_function.Pass(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 // AnimationCurve implementation | 128 // AnimationCurve implementation |
| 129 virtual double Duration() const OVERRIDE; | 129 virtual double Duration() const override; |
| 130 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; | 130 virtual scoped_ptr<AnimationCurve> Clone() const override; |
| 131 | 131 |
| 132 // BackgrounColorAnimationCurve implementation | 132 // BackgrounColorAnimationCurve implementation |
| 133 virtual SkColor GetValue(double t) const OVERRIDE; | 133 virtual SkColor GetValue(double t) const override; |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 KeyframedColorAnimationCurve(); | 136 KeyframedColorAnimationCurve(); |
| 137 | 137 |
| 138 // Always sorted in order of increasing time. No two keyframes have the | 138 // Always sorted in order of increasing time. No two keyframes have the |
| 139 // same time. | 139 // same time. |
| 140 ScopedPtrVector<ColorKeyframe> keyframes_; | 140 ScopedPtrVector<ColorKeyframe> keyframes_; |
| 141 scoped_ptr<TimingFunction> timing_function_; | 141 scoped_ptr<TimingFunction> timing_function_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(KeyframedColorAnimationCurve); | 143 DISALLOW_COPY_AND_ASSIGN(KeyframedColorAnimationCurve); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve { | 146 class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve { |
| 147 public: | 147 public: |
| 148 // It is required that the keyframes be sorted by time. | 148 // It is required that the keyframes be sorted by time. |
| 149 static scoped_ptr<KeyframedFloatAnimationCurve> Create(); | 149 static scoped_ptr<KeyframedFloatAnimationCurve> Create(); |
| 150 | 150 |
| 151 virtual ~KeyframedFloatAnimationCurve(); | 151 virtual ~KeyframedFloatAnimationCurve(); |
| 152 | 152 |
| 153 void AddKeyframe(scoped_ptr<FloatKeyframe> keyframe); | 153 void AddKeyframe(scoped_ptr<FloatKeyframe> keyframe); |
| 154 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { | 154 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { |
| 155 timing_function_ = timing_function.Pass(); | 155 timing_function_ = timing_function.Pass(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // AnimationCurve implementation | 158 // AnimationCurve implementation |
| 159 virtual double Duration() const OVERRIDE; | 159 virtual double Duration() const override; |
| 160 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; | 160 virtual scoped_ptr<AnimationCurve> Clone() const override; |
| 161 | 161 |
| 162 // FloatAnimationCurve implementation | 162 // FloatAnimationCurve implementation |
| 163 virtual float GetValue(double t) const OVERRIDE; | 163 virtual float GetValue(double t) const override; |
| 164 | 164 |
| 165 private: | 165 private: |
| 166 KeyframedFloatAnimationCurve(); | 166 KeyframedFloatAnimationCurve(); |
| 167 | 167 |
| 168 // Always sorted in order of increasing time. No two keyframes have the | 168 // Always sorted in order of increasing time. No two keyframes have the |
| 169 // same time. | 169 // same time. |
| 170 ScopedPtrVector<FloatKeyframe> keyframes_; | 170 ScopedPtrVector<FloatKeyframe> keyframes_; |
| 171 scoped_ptr<TimingFunction> timing_function_; | 171 scoped_ptr<TimingFunction> timing_function_; |
| 172 | 172 |
| 173 DISALLOW_COPY_AND_ASSIGN(KeyframedFloatAnimationCurve); | 173 DISALLOW_COPY_AND_ASSIGN(KeyframedFloatAnimationCurve); |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 class CC_EXPORT KeyframedTransformAnimationCurve | 176 class CC_EXPORT KeyframedTransformAnimationCurve |
| 177 : public TransformAnimationCurve { | 177 : public TransformAnimationCurve { |
| 178 public: | 178 public: |
| 179 // It is required that the keyframes be sorted by time. | 179 // It is required that the keyframes be sorted by time. |
| 180 static scoped_ptr<KeyframedTransformAnimationCurve> Create(); | 180 static scoped_ptr<KeyframedTransformAnimationCurve> Create(); |
| 181 | 181 |
| 182 virtual ~KeyframedTransformAnimationCurve(); | 182 virtual ~KeyframedTransformAnimationCurve(); |
| 183 | 183 |
| 184 void AddKeyframe(scoped_ptr<TransformKeyframe> keyframe); | 184 void AddKeyframe(scoped_ptr<TransformKeyframe> keyframe); |
| 185 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { | 185 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { |
| 186 timing_function_ = timing_function.Pass(); | 186 timing_function_ = timing_function.Pass(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 // AnimationCurve implementation | 189 // AnimationCurve implementation |
| 190 virtual double Duration() const OVERRIDE; | 190 virtual double Duration() const override; |
| 191 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; | 191 virtual scoped_ptr<AnimationCurve> Clone() const override; |
| 192 | 192 |
| 193 // TransformAnimationCurve implementation | 193 // TransformAnimationCurve implementation |
| 194 virtual gfx::Transform GetValue(double t) const OVERRIDE; | 194 virtual gfx::Transform GetValue(double t) const override; |
| 195 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, | 195 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, |
| 196 gfx::BoxF* bounds) const OVERRIDE; | 196 gfx::BoxF* bounds) const override; |
| 197 virtual bool AffectsScale() const OVERRIDE; | 197 virtual bool AffectsScale() const override; |
| 198 virtual bool IsTranslation() const OVERRIDE; | 198 virtual bool IsTranslation() const override; |
| 199 virtual bool MaximumScale(float* max_scale) const OVERRIDE; | 199 virtual bool MaximumScale(float* max_scale) const override; |
| 200 | 200 |
| 201 private: | 201 private: |
| 202 KeyframedTransformAnimationCurve(); | 202 KeyframedTransformAnimationCurve(); |
| 203 | 203 |
| 204 // Always sorted in order of increasing time. No two keyframes have the | 204 // Always sorted in order of increasing time. No two keyframes have the |
| 205 // same time. | 205 // same time. |
| 206 ScopedPtrVector<TransformKeyframe> keyframes_; | 206 ScopedPtrVector<TransformKeyframe> keyframes_; |
| 207 scoped_ptr<TimingFunction> timing_function_; | 207 scoped_ptr<TimingFunction> timing_function_; |
| 208 | 208 |
| 209 DISALLOW_COPY_AND_ASSIGN(KeyframedTransformAnimationCurve); | 209 DISALLOW_COPY_AND_ASSIGN(KeyframedTransformAnimationCurve); |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 class CC_EXPORT KeyframedFilterAnimationCurve | 212 class CC_EXPORT KeyframedFilterAnimationCurve |
| 213 : public FilterAnimationCurve { | 213 : public FilterAnimationCurve { |
| 214 public: | 214 public: |
| 215 // It is required that the keyframes be sorted by time. | 215 // It is required that the keyframes be sorted by time. |
| 216 static scoped_ptr<KeyframedFilterAnimationCurve> Create(); | 216 static scoped_ptr<KeyframedFilterAnimationCurve> Create(); |
| 217 | 217 |
| 218 virtual ~KeyframedFilterAnimationCurve(); | 218 virtual ~KeyframedFilterAnimationCurve(); |
| 219 | 219 |
| 220 void AddKeyframe(scoped_ptr<FilterKeyframe> keyframe); | 220 void AddKeyframe(scoped_ptr<FilterKeyframe> keyframe); |
| 221 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { | 221 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { |
| 222 timing_function_ = timing_function.Pass(); | 222 timing_function_ = timing_function.Pass(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 // AnimationCurve implementation | 225 // AnimationCurve implementation |
| 226 virtual double Duration() const OVERRIDE; | 226 virtual double Duration() const override; |
| 227 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; | 227 virtual scoped_ptr<AnimationCurve> Clone() const override; |
| 228 | 228 |
| 229 // FilterAnimationCurve implementation | 229 // FilterAnimationCurve implementation |
| 230 virtual FilterOperations GetValue(double t) const OVERRIDE; | 230 virtual FilterOperations GetValue(double t) const override; |
| 231 virtual bool HasFilterThatMovesPixels() const OVERRIDE; | 231 virtual bool HasFilterThatMovesPixels() const override; |
| 232 | 232 |
| 233 private: | 233 private: |
| 234 KeyframedFilterAnimationCurve(); | 234 KeyframedFilterAnimationCurve(); |
| 235 | 235 |
| 236 // Always sorted in order of increasing time. No two keyframes have the | 236 // Always sorted in order of increasing time. No two keyframes have the |
| 237 // same time. | 237 // same time. |
| 238 ScopedPtrVector<FilterKeyframe> keyframes_; | 238 ScopedPtrVector<FilterKeyframe> keyframes_; |
| 239 scoped_ptr<TimingFunction> timing_function_; | 239 scoped_ptr<TimingFunction> timing_function_; |
| 240 | 240 |
| 241 DISALLOW_COPY_AND_ASSIGN(KeyframedFilterAnimationCurve); | 241 DISALLOW_COPY_AND_ASSIGN(KeyframedFilterAnimationCurve); |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 } // namespace cc | 244 } // namespace cc |
| 245 | 245 |
| 246 #endif // CC_ANIMATION_KEYFRAMED_ANIMATION_CURVE_H_ | 246 #endif // CC_ANIMATION_KEYFRAMED_ANIMATION_CURVE_H_ |
| OLD | NEW |