Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(880)

Unified Diff: cc/animation/keyframed_animation_curve.cc

Issue 606543002: CC: Stop TimingFunction inheriting from AnimationCurve. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test by using FakeFloatAnimationCurve, added import. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/animation/timing_function.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/keyframed_animation_curve.cc
diff --git a/cc/animation/keyframed_animation_curve.cc b/cc/animation/keyframed_animation_curve.cc
index 4522ca2e6d98029a155e540743d4a2a7a653c429..e98a2e6945dbbf3c8a2f36fcac1ca2ffce79ff06 100644
--- a/cc/animation/keyframed_animation_curve.cc
+++ b/cc/animation/keyframed_animation_curve.cc
@@ -40,14 +40,6 @@ float GetProgress(double t, size_t i, const Keyframes& keyframes) {
return progress;
}
-scoped_ptr<TimingFunction> CloneTimingFunction(
- const TimingFunction* timing_function) {
- DCHECK(timing_function);
- scoped_ptr<AnimationCurve> curve(timing_function->Clone());
- return scoped_ptr<TimingFunction>(
- static_cast<TimingFunction*>(curve.release()));
-}
-
} // namespace
Keyframe::Keyframe(double time, scoped_ptr<TimingFunction> timing_function)
@@ -81,7 +73,7 @@ SkColor ColorKeyframe::Value() const { return value_; }
scoped_ptr<ColorKeyframe> ColorKeyframe::Clone() const {
scoped_ptr<TimingFunction> func;
if (timing_function())
- func = CloneTimingFunction(timing_function());
+ func = timing_function()->Clone();
return ColorKeyframe::Create(Time(), Value(), func.Pass());
}
@@ -108,7 +100,7 @@ float FloatKeyframe::Value() const {
scoped_ptr<FloatKeyframe> FloatKeyframe::Clone() const {
scoped_ptr<TimingFunction> func;
if (timing_function())
- func = CloneTimingFunction(timing_function());
+ func = timing_function()->Clone();
return FloatKeyframe::Create(Time(), Value(), func.Pass());
}
@@ -135,7 +127,7 @@ const TransformOperations& TransformKeyframe::Value() const {
scoped_ptr<TransformKeyframe> TransformKeyframe::Clone() const {
scoped_ptr<TimingFunction> func;
if (timing_function())
- func = CloneTimingFunction(timing_function());
+ func = timing_function()->Clone();
return TransformKeyframe::Create(Time(), Value(), func.Pass());
}
@@ -162,7 +154,7 @@ const FilterOperations& FilterKeyframe::Value() const {
scoped_ptr<FilterKeyframe> FilterKeyframe::Clone() const {
scoped_ptr<TimingFunction> func;
if (timing_function())
- func = CloneTimingFunction(timing_function());
+ func = timing_function()->Clone();
return FilterKeyframe::Create(Time(), Value(), func.Pass());
}
« no previous file with comments | « no previous file | cc/animation/timing_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698