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/geometry/cubic_bezier.h" |
| 11 #include "ui/gfx/geometry/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 23 matching lines...) Expand all Loading... |
44 | 45 |
45 protected: | 46 protected: |
46 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); | 47 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); |
47 | 48 |
48 gfx::CubicBezier bezier_; | 49 gfx::CubicBezier bezier_; |
49 | 50 |
50 private: | 51 private: |
51 DISALLOW_ASSIGN(CubicBezierTimingFunction); | 52 DISALLOW_ASSIGN(CubicBezierTimingFunction); |
52 }; | 53 }; |
53 | 54 |
| 55 class CC_EXPORT StepsTimingFunction : public TimingFunction { |
| 56 public: |
| 57 static scoped_ptr<StepsTimingFunction> Create(int steps, bool steps_at_start); |
| 58 virtual ~StepsTimingFunction(); |
| 59 |
| 60 virtual float GetValue(double time) const OVERRIDE; |
| 61 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; |
| 62 virtual void Range(float* min, float* max) const OVERRIDE; |
| 63 |
| 64 protected: |
| 65 StepsTimingFunction(int steps, bool steps_at_start); |
| 66 |
| 67 gfx::Steps steps_; |
| 68 |
| 69 private: |
| 70 DISALLOW_ASSIGN(StepsTimingFunction); |
| 71 }; |
| 72 |
54 class CC_EXPORT EaseTimingFunction { | 73 class CC_EXPORT EaseTimingFunction { |
55 public: | 74 public: |
56 static scoped_ptr<TimingFunction> Create(); | 75 static scoped_ptr<TimingFunction> Create(); |
57 | 76 |
58 private: | 77 private: |
59 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseTimingFunction); | 78 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseTimingFunction); |
60 }; | 79 }; |
61 | 80 |
62 class CC_EXPORT EaseInTimingFunction { | 81 class CC_EXPORT EaseInTimingFunction { |
63 public: | 82 public: |
(...skipping 15 matching lines...) Expand all Loading... |
79 public: | 98 public: |
80 static scoped_ptr<TimingFunction> Create(); | 99 static scoped_ptr<TimingFunction> Create(); |
81 | 100 |
82 private: | 101 private: |
83 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInOutTimingFunction); | 102 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInOutTimingFunction); |
84 }; | 103 }; |
85 | 104 |
86 } // namespace cc | 105 } // namespace cc |
87 | 106 |
88 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ | 107 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ |
OLD | NEW |