Index: ui/gfx/geometry/cubic_bezier.h |
diff --git a/ui/gfx/screen_type_delegate.h b/ui/gfx/geometry/cubic_bezier.h |
similarity index 25% |
copy from ui/gfx/screen_type_delegate.h |
copy to ui/gfx/geometry/cubic_bezier.h |
index 4d9f116aedd6f8dce1d8643a7b550879735bd738..4065d4469034e52c1cc8453e09b0ab74f0b2bd4f 100644 |
--- a/ui/gfx/screen_type_delegate.h |
+++ b/ui/gfx/geometry/cubic_bezier.h |
@@ -2,31 +2,35 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef UI_GFX_SCREEN_TYPE_DELEGATE_H_ |
-#define UI_GFX_SCREEN_TYPE_DELEGATE_H_ |
+#ifndef UI_GFX_GEOMETRY_CUBIC_BEZIER_H_ |
sky
2014/02/04 15:14:40
nit: play with the --similarity so this isn't seen
|
+#define UI_GFX_GEOMETRY_CUBIC_BEZIER_H_ |
-#include "ui/gfx/native_widget_types.h" |
+#include "base/macros.h" |
+#include "ui/gfx/gfx_export.h" |
namespace gfx { |
-enum GFX_EXPORT ScreenType { |
- SCREEN_TYPE_NATIVE = 0, |
-#if defined(OS_CHROMEOS) |
- SCREEN_TYPE_ALTERNATE = SCREEN_TYPE_NATIVE, |
-#else |
- SCREEN_TYPE_ALTERNATE, |
-#endif |
- SCREEN_TYPE_LAST = SCREEN_TYPE_ALTERNATE, |
-}; |
- |
-class GFX_EXPORT ScreenTypeDelegate { |
+class GFX_EXPORT CubicBezier { |
public: |
- virtual ~ScreenTypeDelegate() {} |
+ CubicBezier(double x1, double y1, double x2, double y2); |
+ virtual ~CubicBezier(); |
sky
2014/02/04 15:14:40
Why the virtual?
|
+ |
+ // 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]. |
+ virtual void Range(double* min, double* max) const; |
+ |
+ private: |
+ double x1_; |
+ double y1_; |
+ double x2_; |
+ double y2_; |
- // Determines which ScreenType a given |view| belongs to. |
- virtual ScreenType GetScreenTypeForNativeView(NativeView view) = 0; |
+ DISALLOW_ASSIGN(CubicBezier); |
}; |
} // namespace gfx |
-#endif // UI_GFX_SCREEN_TYPE_DELEGATE_H_ |
+#endif // UI_GFX_GEOMETRY_CUBIC_BEZIER_H_ |