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 CCTimingFunction_h | 5 #ifndef CCTimingFunction_h |
6 #define CCTimingFunction_h | 6 #define CCTimingFunction_h |
7 | 7 |
8 #include "CCAnimationCurve.h" | 8 #include "CCAnimationCurve.h" |
9 #include "UnitBezier.h" | 9 #include "UnitBezier.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 // See http://www.w3.org/TR/css3-transitions/. | 13 // See http://www.w3.org/TR/css3-transitions/. |
14 class CCTimingFunction : public CCFloatAnimationCurve { | 14 class TimingFunction : public FloatAnimationCurve { |
15 public: | 15 public: |
16 virtual ~CCTimingFunction(); | 16 virtual ~TimingFunction(); |
17 | 17 |
18 // Partial implementation of CCFloatAnimationCurve. | 18 // Partial implementation of FloatAnimationCurve. |
19 virtual double duration() const OVERRIDE; | 19 virtual double duration() const OVERRIDE; |
20 | 20 |
21 protected: | 21 protected: |
22 CCTimingFunction(); | 22 TimingFunction(); |
23 }; | 23 }; |
24 | 24 |
25 class CCCubicBezierTimingFunction : public CCTimingFunction { | 25 class CubicBezierTimingFunction : public TimingFunction { |
26 public: | 26 public: |
27 static scoped_ptr<CCCubicBezierTimingFunction> create(double x1, double y1,
double x2, double y2); | 27 static scoped_ptr<CubicBezierTimingFunction> create(double x1, double y1, do
uble x2, double y2); |
28 virtual ~CCCubicBezierTimingFunction(); | 28 virtual ~CubicBezierTimingFunction(); |
29 | 29 |
30 // Partial implementation of CCFloatAnimationCurve. | 30 // Partial implementation of FloatAnimationCurve. |
31 virtual float getValue(double time) const OVERRIDE; | 31 virtual float getValue(double time) const OVERRIDE; |
32 virtual scoped_ptr<CCAnimationCurve> clone() const OVERRIDE; | 32 virtual scoped_ptr<AnimationCurve> clone() const OVERRIDE; |
33 | 33 |
34 protected: | 34 protected: |
35 CCCubicBezierTimingFunction(double x1, double y1, double x2, double y2); | 35 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); |
36 | 36 |
37 UnitBezier m_curve; | 37 UnitBezier m_curve; |
38 }; | 38 }; |
39 | 39 |
40 class CCEaseTimingFunction { | 40 class EaseTimingFunction { |
41 public: | 41 public: |
42 static scoped_ptr<CCTimingFunction> create(); | 42 static scoped_ptr<TimingFunction> create(); |
43 }; | 43 }; |
44 | 44 |
45 class CCEaseInTimingFunction { | 45 class EaseInTimingFunction { |
46 public: | 46 public: |
47 static scoped_ptr<CCTimingFunction> create(); | 47 static scoped_ptr<TimingFunction> create(); |
48 }; | 48 }; |
49 | 49 |
50 class CCEaseOutTimingFunction { | 50 class EaseOutTimingFunction { |
51 public: | 51 public: |
52 static scoped_ptr<CCTimingFunction> create(); | 52 static scoped_ptr<TimingFunction> create(); |
53 }; | 53 }; |
54 | 54 |
55 class CCEaseInOutTimingFunction { | 55 class EaseInOutTimingFunction { |
56 public: | 56 public: |
57 static scoped_ptr<CCTimingFunction> create(); | 57 static scoped_ptr<TimingFunction> create(); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace cc | 60 } // namespace cc |
61 | 61 |
62 #endif // CCTimingFunction_h | 62 #endif // CCTimingFunction_h |
OLD | NEW |