OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_ANIMATION_TIMING_FUNCTION_H_ | 5 #ifndef CC_ANIMATION_TIMING_FUNCTION_H_ |
6 #define CC_ANIMATION_TIMING_FUNCTION_H_ | 6 #define CC_ANIMATION_TIMING_FUNCTION_H_ |
7 | 7 |
8 #include "cc/animation/animation_curve.h" | 8 #include "cc/animation/animation_curve.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "ui/gfx/geometry/cubic_bezier.h" | 10 #include "ui/gfx/animation/cubic_bezier.h" |
| 11 #include "ui/gfx/animation/steps.h" |
11 | 12 |
12 namespace cc { | 13 namespace cc { |
13 | 14 |
14 // See http://www.w3.org/TR/css3-transitions/. | 15 // See http://www.w3.org/TR/css3-transitions/. |
15 class CC_EXPORT TimingFunction : public FloatAnimationCurve { | 16 class CC_EXPORT TimingFunction : public FloatAnimationCurve { |
16 public: | 17 public: |
17 virtual ~TimingFunction(); | 18 virtual ~TimingFunction(); |
18 | 19 |
19 // Partial implementation of FloatAnimationCurve. | 20 // Partial implementation of FloatAnimationCurve. |
20 virtual double Duration() const OVERRIDE; | 21 virtual double Duration() const OVERRIDE; |
(...skipping 25 matching lines...) Expand all Loading... |
46 | 47 |
47 protected: | 48 protected: |
48 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); | 49 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); |
49 | 50 |
50 gfx::CubicBezier bezier_; | 51 gfx::CubicBezier bezier_; |
51 | 52 |
52 private: | 53 private: |
53 DISALLOW_ASSIGN(CubicBezierTimingFunction); | 54 DISALLOW_ASSIGN(CubicBezierTimingFunction); |
54 }; | 55 }; |
55 | 56 |
| 57 class CC_EXPORT StepsTimingFunction : public TimingFunction { |
| 58 public: |
| 59 static scoped_ptr<StepsTimingFunction> Create(int steps, bool steps_at_start); |
| 60 virtual ~StepsTimingFunction(); |
| 61 |
| 62 virtual float GetValue(double time) const OVERRIDE; |
| 63 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; |
| 64 |
| 65 virtual void Range(float* min, float* max) const OVERRIDE; |
| 66 virtual float Velocity(double time) const OVERRIDE; |
| 67 |
| 68 protected: |
| 69 StepsTimingFunction(int steps, bool steps_at_start); |
| 70 |
| 71 gfx::Steps steps_; |
| 72 |
| 73 private: |
| 74 DISALLOW_ASSIGN(StepsTimingFunction); |
| 75 }; |
| 76 |
56 class CC_EXPORT EaseTimingFunction { | 77 class CC_EXPORT EaseTimingFunction { |
57 public: | 78 public: |
58 static scoped_ptr<TimingFunction> Create(); | 79 static scoped_ptr<TimingFunction> Create(); |
59 | 80 |
60 private: | 81 private: |
61 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseTimingFunction); | 82 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseTimingFunction); |
62 }; | 83 }; |
63 | 84 |
64 class CC_EXPORT EaseInTimingFunction { | 85 class CC_EXPORT EaseInTimingFunction { |
65 public: | 86 public: |
(...skipping 15 matching lines...) Expand all Loading... |
81 public: | 102 public: |
82 static scoped_ptr<TimingFunction> Create(); | 103 static scoped_ptr<TimingFunction> Create(); |
83 | 104 |
84 private: | 105 private: |
85 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInOutTimingFunction); | 106 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInOutTimingFunction); |
86 }; | 107 }; |
87 | 108 |
88 } // namespace cc | 109 } // namespace cc |
89 | 110 |
90 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ | 111 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ |
OLD | NEW |