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_TIMING_FUNCTION_H_ | 5 #ifndef CC_TIMING_FUNCTION_H_ |
6 #define CC_TIMING_FUNCTION_H_ | 6 #define CC_TIMING_FUNCTION_H_ |
7 | 7 |
8 #include "cc/animation_curve.h" | 8 #include "cc/animation_curve.h" |
9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
10 #include "third_party/skia/include/core/SkScalar.h" | 10 #include "third_party/skia/include/core/SkScalar.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 // See http://www.w3.org/TR/css3-transitions/. | 14 // See http://www.w3.org/TR/css3-transitions/. |
15 class CC_EXPORT TimingFunction : public FloatAnimationCurve { | 15 class CC_EXPORT TimingFunction : public FloatAnimationCurve { |
16 public: | 16 public: |
17 virtual ~TimingFunction(); | 17 virtual ~TimingFunction(); |
18 | 18 |
19 // Partial implementation of FloatAnimationCurve. | 19 // Partial implementation of FloatAnimationCurve. |
20 virtual double duration() const OVERRIDE; | 20 virtual double duration() const OVERRIDE; |
21 | 21 |
22 protected: | 22 protected: |
23 TimingFunction(); | 23 TimingFunction(); |
24 }; | 24 }; |
25 | 25 |
26 class CC_EXPORT CubicBezierTimingFunction : public TimingFunction { | 26 class CC_EXPORT CubicBezierTimingFunction : public TimingFunction { |
27 public: | 27 public: |
28 static scoped_ptr<CubicBezierTimingFunction> create(double x1, double y1, do
uble x2, double y2); | 28 static scoped_ptr<CubicBezierTimingFunction> create(double x1, double y1, |
29 virtual ~CubicBezierTimingFunction(); | 29 double x2, double y2); |
| 30 virtual ~CubicBezierTimingFunction(); |
30 | 31 |
31 // Partial implementation of FloatAnimationCurve. | 32 // Partial implementation of FloatAnimationCurve. |
32 virtual float getValue(double time) const OVERRIDE; | 33 virtual float getValue(double time) const OVERRIDE; |
33 virtual scoped_ptr<AnimationCurve> clone() const OVERRIDE; | 34 virtual scoped_ptr<AnimationCurve> clone() const OVERRIDE; |
34 | 35 |
35 protected: | 36 protected: |
36 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); | 37 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); |
37 | 38 |
38 SkScalar m_x1; | 39 SkScalar x1_; |
39 SkScalar m_y1; | 40 SkScalar y1_; |
40 SkScalar m_x2; | 41 SkScalar x2_; |
41 SkScalar m_y2; | 42 SkScalar y2_; |
42 }; | 43 }; |
43 | 44 |
44 class CC_EXPORT EaseTimingFunction { | 45 class CC_EXPORT EaseTimingFunction { |
45 public: | 46 public: |
46 static scoped_ptr<TimingFunction> create(); | 47 static scoped_ptr<TimingFunction> create(); |
47 }; | 48 }; |
48 | 49 |
49 class CC_EXPORT EaseInTimingFunction { | 50 class CC_EXPORT EaseInTimingFunction { |
50 public: | 51 public: |
51 static scoped_ptr<TimingFunction> create(); | 52 static scoped_ptr<TimingFunction> create(); |
52 }; | 53 }; |
53 | 54 |
54 class CC_EXPORT EaseOutTimingFunction { | 55 class CC_EXPORT EaseOutTimingFunction { |
55 public: | 56 public: |
56 static scoped_ptr<TimingFunction> create(); | 57 static scoped_ptr<TimingFunction> create(); |
57 }; | 58 }; |
58 | 59 |
59 class CC_EXPORT EaseInOutTimingFunction { | 60 class CC_EXPORT EaseInOutTimingFunction { |
60 public: | 61 public: |
61 static scoped_ptr<TimingFunction> create(); | 62 static scoped_ptr<TimingFunction> create(); |
62 }; | 63 }; |
63 | 64 |
64 } // namespace cc | 65 } // namespace cc |
65 | 66 |
66 #endif // CC_TIMING_FUNCTION_H_ | 67 #endif // CC_TIMING_FUNCTION_H_ |
OLD | NEW |