Chromium Code Reviews| 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 "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "cc/animation/animation_curve.h" | 9 #include "cc/animation/animation_curve.h" |
| 10 #include "cc/animation/timing_function.h" | 10 #include "cc/animation/timing_function.h" |
| 11 #include "cc/animation/transform_operations.h" | 11 #include "cc/animation/transform_operations.h" |
| 12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
| 13 #include "cc/base/scoped_ptr_vector.h" | |
|
danakj
2015/11/17 01:12:16
include vector tho, iwyu
vmpstr
2015/11/17 23:26:23
Done.
| |
| 14 | 13 |
| 15 namespace cc { | 14 namespace cc { |
| 16 | 15 |
| 17 class CC_EXPORT Keyframe { | 16 class CC_EXPORT Keyframe { |
| 18 public: | 17 public: |
| 19 base::TimeDelta Time() const; | 18 base::TimeDelta Time() const; |
| 20 const TimingFunction* timing_function() const { | 19 const TimingFunction* timing_function() const { |
| 21 return timing_function_.get(); | 20 return timing_function_.get(); |
| 22 } | 21 } |
| 23 | 22 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 scoped_ptr<AnimationCurve> Clone() const override; | 128 scoped_ptr<AnimationCurve> Clone() const override; |
| 130 | 129 |
| 131 // BackgrounColorAnimationCurve implementation | 130 // BackgrounColorAnimationCurve implementation |
| 132 SkColor GetValue(base::TimeDelta t) const override; | 131 SkColor GetValue(base::TimeDelta t) const override; |
| 133 | 132 |
| 134 private: | 133 private: |
| 135 KeyframedColorAnimationCurve(); | 134 KeyframedColorAnimationCurve(); |
| 136 | 135 |
| 137 // Always sorted in order of increasing time. No two keyframes have the | 136 // Always sorted in order of increasing time. No two keyframes have the |
| 138 // same time. | 137 // same time. |
| 139 ScopedPtrVector<ColorKeyframe> keyframes_; | 138 std::vector<scoped_ptr<ColorKeyframe>> keyframes_; |
| 140 scoped_ptr<TimingFunction> timing_function_; | 139 scoped_ptr<TimingFunction> timing_function_; |
| 141 | 140 |
| 142 DISALLOW_COPY_AND_ASSIGN(KeyframedColorAnimationCurve); | 141 DISALLOW_COPY_AND_ASSIGN(KeyframedColorAnimationCurve); |
| 143 }; | 142 }; |
| 144 | 143 |
| 145 class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve { | 144 class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve { |
| 146 public: | 145 public: |
| 147 // It is required that the keyframes be sorted by time. | 146 // It is required that the keyframes be sorted by time. |
| 148 static scoped_ptr<KeyframedFloatAnimationCurve> Create(); | 147 static scoped_ptr<KeyframedFloatAnimationCurve> Create(); |
| 149 | 148 |
| 150 ~KeyframedFloatAnimationCurve() override; | 149 ~KeyframedFloatAnimationCurve() override; |
| 151 | 150 |
| 152 void AddKeyframe(scoped_ptr<FloatKeyframe> keyframe); | 151 void AddKeyframe(scoped_ptr<FloatKeyframe> keyframe); |
| 153 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { | 152 void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { |
| 154 timing_function_ = timing_function.Pass(); | 153 timing_function_ = timing_function.Pass(); |
| 155 } | 154 } |
| 156 | 155 |
| 157 // AnimationCurve implementation | 156 // AnimationCurve implementation |
| 158 base::TimeDelta Duration() const override; | 157 base::TimeDelta Duration() const override; |
| 159 scoped_ptr<AnimationCurve> Clone() const override; | 158 scoped_ptr<AnimationCurve> Clone() const override; |
| 160 | 159 |
| 161 // FloatAnimationCurve implementation | 160 // FloatAnimationCurve implementation |
| 162 float GetValue(base::TimeDelta t) const override; | 161 float GetValue(base::TimeDelta t) const override; |
| 163 | 162 |
| 164 private: | 163 private: |
| 165 KeyframedFloatAnimationCurve(); | 164 KeyframedFloatAnimationCurve(); |
| 166 | 165 |
| 167 // Always sorted in order of increasing time. No two keyframes have the | 166 // Always sorted in order of increasing time. No two keyframes have the |
| 168 // same time. | 167 // same time. |
| 169 ScopedPtrVector<FloatKeyframe> keyframes_; | 168 std::vector<scoped_ptr<FloatKeyframe>> keyframes_; |
| 170 scoped_ptr<TimingFunction> timing_function_; | 169 scoped_ptr<TimingFunction> timing_function_; |
| 171 | 170 |
| 172 DISALLOW_COPY_AND_ASSIGN(KeyframedFloatAnimationCurve); | 171 DISALLOW_COPY_AND_ASSIGN(KeyframedFloatAnimationCurve); |
| 173 }; | 172 }; |
| 174 | 173 |
| 175 class CC_EXPORT KeyframedTransformAnimationCurve | 174 class CC_EXPORT KeyframedTransformAnimationCurve |
| 176 : public TransformAnimationCurve { | 175 : public TransformAnimationCurve { |
| 177 public: | 176 public: |
| 178 // It is required that the keyframes be sorted by time. | 177 // It is required that the keyframes be sorted by time. |
| 179 static scoped_ptr<KeyframedTransformAnimationCurve> Create(); | 178 static scoped_ptr<KeyframedTransformAnimationCurve> Create(); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 199 bool AnimationStartScale(bool forward_direction, | 198 bool AnimationStartScale(bool forward_direction, |
| 200 float* start_scale) const override; | 199 float* start_scale) const override; |
| 201 bool MaximumTargetScale(bool forward_direction, | 200 bool MaximumTargetScale(bool forward_direction, |
| 202 float* max_scale) const override; | 201 float* max_scale) const override; |
| 203 | 202 |
| 204 private: | 203 private: |
| 205 KeyframedTransformAnimationCurve(); | 204 KeyframedTransformAnimationCurve(); |
| 206 | 205 |
| 207 // Always sorted in order of increasing time. No two keyframes have the | 206 // Always sorted in order of increasing time. No two keyframes have the |
| 208 // same time. | 207 // same time. |
| 209 ScopedPtrVector<TransformKeyframe> keyframes_; | 208 std::vector<scoped_ptr<TransformKeyframe>> keyframes_; |
| 210 scoped_ptr<TimingFunction> timing_function_; | 209 scoped_ptr<TimingFunction> timing_function_; |
| 211 | 210 |
| 212 DISALLOW_COPY_AND_ASSIGN(KeyframedTransformAnimationCurve); | 211 DISALLOW_COPY_AND_ASSIGN(KeyframedTransformAnimationCurve); |
| 213 }; | 212 }; |
| 214 | 213 |
| 215 class CC_EXPORT KeyframedFilterAnimationCurve | 214 class CC_EXPORT KeyframedFilterAnimationCurve |
| 216 : public FilterAnimationCurve { | 215 : public FilterAnimationCurve { |
| 217 public: | 216 public: |
| 218 // It is required that the keyframes be sorted by time. | 217 // It is required that the keyframes be sorted by time. |
| 219 static scoped_ptr<KeyframedFilterAnimationCurve> Create(); | 218 static scoped_ptr<KeyframedFilterAnimationCurve> Create(); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 231 | 230 |
| 232 // FilterAnimationCurve implementation | 231 // FilterAnimationCurve implementation |
| 233 FilterOperations GetValue(base::TimeDelta t) const override; | 232 FilterOperations GetValue(base::TimeDelta t) const override; |
| 234 bool HasFilterThatMovesPixels() const override; | 233 bool HasFilterThatMovesPixels() const override; |
| 235 | 234 |
| 236 private: | 235 private: |
| 237 KeyframedFilterAnimationCurve(); | 236 KeyframedFilterAnimationCurve(); |
| 238 | 237 |
| 239 // Always sorted in order of increasing time. No two keyframes have the | 238 // Always sorted in order of increasing time. No two keyframes have the |
| 240 // same time. | 239 // same time. |
| 241 ScopedPtrVector<FilterKeyframe> keyframes_; | 240 std::vector<scoped_ptr<FilterKeyframe>> keyframes_; |
| 242 scoped_ptr<TimingFunction> timing_function_; | 241 scoped_ptr<TimingFunction> timing_function_; |
| 243 | 242 |
| 244 DISALLOW_COPY_AND_ASSIGN(KeyframedFilterAnimationCurve); | 243 DISALLOW_COPY_AND_ASSIGN(KeyframedFilterAnimationCurve); |
| 245 }; | 244 }; |
| 246 | 245 |
| 247 } // namespace cc | 246 } // namespace cc |
| 248 | 247 |
| 249 #endif // CC_ANIMATION_KEYFRAMED_ANIMATION_CURVE_H_ | 248 #endif // CC_ANIMATION_KEYFRAMED_ANIMATION_CURVE_H_ |
| OLD | NEW |