Ozone: Temporarily remove DCHECK in BufferFactory.
[chromium-blink-merge.git] / cc / animation / timing_function.h
blob69d1cc9fb5c43203cb0f79949adb3415fc216a2a
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_ANIMATION_TIMING_FUNCTION_H_
6 #define CC_ANIMATION_TIMING_FUNCTION_H_
8 #include "cc/base/cc_export.h"
9 #include "ui/gfx/geometry/cubic_bezier.h"
11 namespace cc {
13 // See http://www.w3.org/TR/css3-transitions/.
14 class CC_EXPORT TimingFunction {
15 public:
16 virtual ~TimingFunction();
18 virtual float GetValue(double t) const = 0;
19 virtual float Velocity(double time) const = 0;
20 // The smallest and largest values returned by GetValue for inputs in [0, 1].
21 virtual void Range(float* min, float* max) const = 0;
22 virtual scoped_ptr<TimingFunction> Clone() const = 0;
24 protected:
25 TimingFunction();
27 private:
28 DISALLOW_ASSIGN(TimingFunction);
31 class CC_EXPORT CubicBezierTimingFunction : public TimingFunction {
32 public:
33 static scoped_ptr<CubicBezierTimingFunction> Create(double x1, double y1,
34 double x2, double y2);
35 ~CubicBezierTimingFunction() override;
37 // TimingFunction implementation.
38 float GetValue(double time) const override;
39 float Velocity(double time) const override;
40 void Range(float* min, float* max) const override;
41 scoped_ptr<TimingFunction> Clone() const override;
43 protected:
44 CubicBezierTimingFunction(double x1, double y1, double x2, double y2);
46 gfx::CubicBezier bezier_;
48 private:
49 DISALLOW_ASSIGN(CubicBezierTimingFunction);
52 class CC_EXPORT EaseTimingFunction {
53 public:
54 static scoped_ptr<TimingFunction> Create();
56 private:
57 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseTimingFunction);
60 class CC_EXPORT EaseInTimingFunction {
61 public:
62 static scoped_ptr<TimingFunction> Create();
64 private:
65 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInTimingFunction);
68 class CC_EXPORT EaseOutTimingFunction {
69 public:
70 static scoped_ptr<TimingFunction> Create();
72 private:
73 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseOutTimingFunction);
76 class CC_EXPORT EaseInOutTimingFunction {
77 public:
78 static scoped_ptr<TimingFunction> Create();
80 private:
81 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInOutTimingFunction);
84 } // namespace cc
86 #endif // CC_ANIMATION_TIMING_FUNCTION_H_