Chromium Code Reviews| Index: ui/gfx/geometry/steps.h |
| diff --git a/ui/gfx/geometry/steps.h b/ui/gfx/geometry/steps.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fc4ecfcbc188e6f6852f11cfcd720c8138178cb1 |
| --- /dev/null |
| +++ b/ui/gfx/geometry/steps.h |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
danakj
2014/09/16 00:16:22
This seems like it is an animation thing not a geo
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_GFX_GEOMETRY_STEPS_H_ |
| +#define UI_GFX_GEOMETRY_STEPS_H_ |
| + |
| +#include "base/macros.h" |
| +#include "ui/gfx/gfx_export.h" |
| + |
| +namespace gfx { |
| + |
| +class GFX_EXPORT Steps { |
| + public: |
| + Steps(int steps, bool steps_at_start); |
| + ~Steps(); |
| + |
| + // Returns y at the given x. |
| + double Solve(double x) const; |
| + |
| + // Sets |min| and |max| to the step functions's minimum and maximium y values |
| + // in the interval [0, 1]. |
| + void Range(double* min, double* max) const; |
| + |
| + private: |
| + int steps_; |
| + bool steps_at_start_; |
| + |
| + DISALLOW_ASSIGN(Steps); |
| +}; |
| + |
| +} // namespace gfx |
| + |
| +#endif // UI_GFX_GEOMETRY_STEPS_H_ |