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

Unified Diff: cc/animation/timing_function.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 | « cc/animation/timing_function.h ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/timing_function.cc
diff --git a/cc/animation/timing_function.cc b/cc/animation/timing_function.cc
index 71319e121d8c10ad3bf2f0c0a6b9dfd37c7bf165..97e0d4bc0b13aff704921a5c8cec943723291e76 100644
--- a/cc/animation/timing_function.cc
+++ b/cc/animation/timing_function.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "cc/animation/timing_function.h"
namespace cc {
@@ -11,10 +12,6 @@ TimingFunction::TimingFunction() {}
TimingFunction::~TimingFunction() {}
-double TimingFunction::Duration() const {
- return 1.0;
-}
-
scoped_ptr<CubicBezierTimingFunction> CubicBezierTimingFunction::Create(
double x1, double y1, double x2, double y2) {
return make_scoped_ptr(new CubicBezierTimingFunction(x1, y1, x2, y2));
@@ -32,9 +29,8 @@ float CubicBezierTimingFunction::GetValue(double x) const {
return static_cast<float>(bezier_.Solve(x));
}
-scoped_ptr<AnimationCurve> CubicBezierTimingFunction::Clone() const {
- return make_scoped_ptr(
- new CubicBezierTimingFunction(*this)).PassAs<AnimationCurve>();
+float CubicBezierTimingFunction::Velocity(double x) const {
+ return static_cast<float>(bezier_.Slope(x));
}
void CubicBezierTimingFunction::Range(float* min, float* max) const {
@@ -45,8 +41,9 @@ void CubicBezierTimingFunction::Range(float* min, float* max) const {
*max = static_cast<float>(max_d);
}
-float CubicBezierTimingFunction::Velocity(double x) const {
- return static_cast<float>(bezier_.Slope(x));
+scoped_ptr<TimingFunction> CubicBezierTimingFunction::Clone() const {
+ return make_scoped_ptr(new CubicBezierTimingFunction(*this))
+ .PassAs<TimingFunction>();
}
// These numbers come from
« no previous file with comments | « cc/animation/timing_function.h ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698