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 "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 | |
25 private: | |
26 DISALLOW_ASSIGN(TimingFunction); | |
24 }; | 27 }; |
25 | 28 |
26 class CC_EXPORT CubicBezierTimingFunction : public TimingFunction { | 29 class CC_EXPORT CubicBezierTimingFunction : public TimingFunction { |
27 public: | 30 public: |
28 static scoped_ptr<CubicBezierTimingFunction> Create(double x1, double y1, | 31 static scoped_ptr<CubicBezierTimingFunction> Create(double x1, double y1, |
29 double x2, double y2); | 32 double x2, double y2); |
30 virtual ~CubicBezierTimingFunction(); | 33 virtual ~CubicBezierTimingFunction(); |
31 | 34 |
32 // Partial implementation of FloatAnimationCurve. | 35 // Partial implementation of FloatAnimationCurve. |
33 virtual float GetValue(double time) const OVERRIDE; | 36 virtual float GetValue(double time) const OVERRIDE; |
34 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; | 37 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; |
35 | 38 |
36 protected: | 39 protected: |
37 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); | 40 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); |
38 | 41 |
39 SkScalar x1_; | 42 SkScalar x1_; |
40 SkScalar y1_; | 43 SkScalar y1_; |
41 SkScalar x2_; | 44 SkScalar x2_; |
42 SkScalar y2_; | 45 SkScalar y2_; |
46 | |
47 private: | |
48 DISALLOW_ASSIGN(CubicBezierTimingFunction); | |
43 }; | 49 }; |
44 | 50 |
45 class CC_EXPORT EaseTimingFunction { | 51 class CC_EXPORT EaseTimingFunction { |
46 public: | 52 public: |
47 static scoped_ptr<TimingFunction> Create(); | 53 static scoped_ptr<TimingFunction> Create(); |
54 | |
55 private: | |
56 DISALLOW_COPY_AND_ASSIGN(EaseTimingFunction); | |
jamesr
2013/03/26 22:06:03
why not DISALLOW_IMPLICIT_... here?
danakj
2013/03/26 22:20:49
Oh, good catch. The Create() call is not calling a
| |
48 }; | 57 }; |
49 | 58 |
50 class CC_EXPORT EaseInTimingFunction { | 59 class CC_EXPORT EaseInTimingFunction { |
51 public: | 60 public: |
52 static scoped_ptr<TimingFunction> Create(); | 61 static scoped_ptr<TimingFunction> Create(); |
62 | |
63 private: | |
64 DISALLOW_COPY_AND_ASSIGN(EaseInTimingFunction); | |
53 }; | 65 }; |
54 | 66 |
55 class CC_EXPORT EaseOutTimingFunction { | 67 class CC_EXPORT EaseOutTimingFunction { |
56 public: | 68 public: |
57 static scoped_ptr<TimingFunction> Create(); | 69 static scoped_ptr<TimingFunction> Create(); |
70 | |
71 private: | |
72 DISALLOW_COPY_AND_ASSIGN(EaseOutTimingFunction); | |
58 }; | 73 }; |
59 | 74 |
60 class CC_EXPORT EaseInOutTimingFunction { | 75 class CC_EXPORT EaseInOutTimingFunction { |
61 public: | 76 public: |
62 static scoped_ptr<TimingFunction> Create(); | 77 static scoped_ptr<TimingFunction> Create(); |
78 | |
79 private: | |
80 DISALLOW_COPY_AND_ASSIGN(EaseInOutTimingFunction); | |
63 }; | 81 }; |
64 | 82 |
65 } // namespace cc | 83 } // namespace cc |
66 | 84 |
67 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ | 85 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ |
OLD | NEW |