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

Unified Diff: ui/gfx/animation/tween.cc

Issue 143413020: Use a bezier timing function for the overview mode animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « ui/gfx/animation/tween.h ('k') | ui/gfx/geometry/cubic_bezier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/animation/tween.cc
diff --git a/ui/gfx/animation/tween.cc b/ui/gfx/animation/tween.cc
index 174305078c27f8425e476d67bb0b5d70afe09351..6353902349b6e0920909ea3d95f970e058631066 100644
--- a/ui/gfx/animation/tween.cc
+++ b/ui/gfx/animation/tween.cc
@@ -14,6 +14,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
+#include "ui/gfx/geometry/cubic_bezier.h"
#include "ui/gfx/safe_integer_conversions.h"
namespace gfx {
@@ -30,6 +31,9 @@ double Tween::CalculateValue(Tween::Type type, double state) {
case EASE_IN_2:
return pow(state, 4);
+ case EASE_IN_BEZIER:
+ return gfx::CubicBezier(.4, 0, 1, .2).Solve(state);
+
case EASE_IN_OUT:
if (state < 0.5)
return pow(state * 2, 2) / 2.0;
@@ -48,6 +52,9 @@ double Tween::CalculateValue(Tween::Type type, double state) {
case EASE_OUT:
return 1.0 - pow(1.0 - state, 2);
+ case EASE_OUT_BEZIER:
+ return gfx::CubicBezier(.4, 0, .2, 1).Solve(state);
+
case SMOOTH_IN_OUT:
return sin(state);
« no previous file with comments | « ui/gfx/animation/tween.h ('k') | ui/gfx/geometry/cubic_bezier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698