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

Unified Diff: ui/gfx/geometry/cubic_bezier.h

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.cc ('k') | ui/gfx/geometry/cubic_bezier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/cubic_bezier.h
diff --git a/ui/gfx/geometry/cubic_bezier.h b/ui/gfx/geometry/cubic_bezier.h
new file mode 100644
index 0000000000000000000000000000000000000000..645dfb7106de68d0cf001a4175cb364c45b409b5
--- /dev/null
+++ b/ui/gfx/geometry/cubic_bezier.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GFX_GEOMETRY_CUBIC_BEZIER_H_
+#define UI_GFX_GEOMETRY_CUBIC_BEZIER_H_
+
+#include "base/macros.h"
+#include "ui/gfx/gfx_export.h"
+
+namespace gfx {
+
+class GFX_EXPORT CubicBezier {
+ public:
+ CubicBezier(double x1, double y1, double x2, double y2);
+ ~CubicBezier();
+
+ // Returns an approximation of y at the given x.
+ double Solve(double x) const;
+
+ // Sets |min| and |max| to the bezier's minimum and maximium y values in the
+ // interval [0, 1].
+ void Range(double* min, double* max) const;
+
+ private:
+ double x1_;
+ double y1_;
+ double x2_;
+ double y2_;
+
+ DISALLOW_ASSIGN(CubicBezier);
+};
+
+} // namespace gfx
+
+#endif // UI_GFX_GEOMETRY_CUBIC_BEZIER_H_
« no previous file with comments | « ui/gfx/animation/tween.cc ('k') | ui/gfx/geometry/cubic_bezier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698