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

Unified Diff: cc/animation/timing_function.h

Issue 140253013: Define accelerated steps time function. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated patch: remove question about velocity 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/keyframed_animation_curve_unittest.cc ('k') | cc/animation/timing_function.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/timing_function.h
diff --git a/cc/animation/timing_function.h b/cc/animation/timing_function.h
index cc979398e4b4b098ece44d57269c1e220605129b..e6cc9972f30ea667b00221c159d025468147ed06 100644
--- a/cc/animation/timing_function.h
+++ b/cc/animation/timing_function.h
@@ -7,7 +7,8 @@
#include "cc/animation/animation_curve.h"
#include "cc/base/cc_export.h"
-#include "ui/gfx/geometry/cubic_bezier.h"
+#include "ui/gfx/animation/cubic_bezier.h"
+#include "ui/gfx/animation/steps.h"
namespace cc {
@@ -53,6 +54,26 @@ class CC_EXPORT CubicBezierTimingFunction : public TimingFunction {
DISALLOW_ASSIGN(CubicBezierTimingFunction);
};
+class CC_EXPORT StepsTimingFunction : public TimingFunction {
+ public:
+ static scoped_ptr<StepsTimingFunction> Create(int steps, bool steps_at_start);
+ virtual ~StepsTimingFunction();
+
+ virtual float GetValue(double time) const OVERRIDE;
+ virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+
+ virtual void Range(float* min, float* max) const OVERRIDE;
+ virtual float Velocity(double time) const OVERRIDE;
+
+ protected:
+ StepsTimingFunction(int steps, bool steps_at_start);
+
+ gfx::Steps steps_;
+
+ private:
+ DISALLOW_ASSIGN(StepsTimingFunction);
+};
+
class CC_EXPORT EaseTimingFunction {
public:
static scoped_ptr<TimingFunction> Create();
« no previous file with comments | « cc/animation/keyframed_animation_curve_unittest.cc ('k') | cc/animation/timing_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698