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