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_TEST_ANIMATION_TEST_COMMON_H_ | 5 #ifndef CC_TEST_ANIMATION_TEST_COMMON_H_ |
6 #define CC_TEST_ANIMATION_TEST_COMMON_H_ | 6 #define CC_TEST_ANIMATION_TEST_COMMON_H_ |
7 | 7 |
8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/animation/animation_curve.h" | 9 #include "cc/animation/animation_curve.h" |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
11 #include "cc/animation/layer_animation_value_observer.h" | 11 #include "cc/animation/layer_animation_value_observer.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 class LayerImpl; | 14 class LayerImpl; |
15 class Layer; | 15 class Layer; |
16 } | 16 } |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 | 19 |
20 class FakeFloatAnimationCurve : public cc::FloatAnimationCurve { | 20 class FakeFloatAnimationCurve : public cc::FloatAnimationCurve { |
21 public: | 21 public: |
22 FakeFloatAnimationCurve(); | 22 FakeFloatAnimationCurve(); |
23 explicit FakeFloatAnimationCurve(double duration); | 23 explicit FakeFloatAnimationCurve(double duration); |
24 virtual ~FakeFloatAnimationCurve(); | 24 virtual ~FakeFloatAnimationCurve(); |
25 | 25 |
26 virtual double Duration() const OVERRIDE; | 26 virtual double Duration() const OVERRIDE; |
27 virtual float GetValue(double now) const OVERRIDE; | 27 virtual float GetValue(double now) const OVERRIDE; |
28 virtual scoped_ptr<cc::AnimationCurve> Clone() const OVERRIDE; | 28 virtual scoped_ptr<cc::AnimationCurve> Clone() const OVERRIDE; |
29 | 29 |
30 private: | 30 private: |
31 double m_duration; | 31 double duration_; |
32 }; | 32 }; |
33 | 33 |
34 class FakeTransformTransition : public cc::TransformAnimationCurve { | 34 class FakeTransformTransition : public cc::TransformAnimationCurve { |
35 public: | 35 public: |
36 FakeTransformTransition(double duration); | 36 FakeTransformTransition(double duration); |
37 virtual ~FakeTransformTransition(); | 37 virtual ~FakeTransformTransition(); |
38 | 38 |
39 virtual double Duration() const OVERRIDE; | 39 virtual double Duration() const OVERRIDE; |
40 virtual gfx::Transform GetValue(double time) const OVERRIDE; | 40 virtual gfx::Transform GetValue(double time) const OVERRIDE; |
41 | 41 |
42 virtual scoped_ptr<cc::AnimationCurve> Clone() const OVERRIDE; | 42 virtual scoped_ptr<cc::AnimationCurve> Clone() const OVERRIDE; |
43 | 43 |
44 private: | 44 private: |
45 double m_duration; | 45 double duration_; |
46 }; | 46 }; |
47 | 47 |
48 class FakeFloatTransition : public cc::FloatAnimationCurve { | 48 class FakeFloatTransition : public cc::FloatAnimationCurve { |
49 public: | 49 public: |
50 FakeFloatTransition(double duration, float from, float to); | 50 FakeFloatTransition(double duration, float from, float to); |
51 virtual ~FakeFloatTransition(); | 51 virtual ~FakeFloatTransition(); |
52 | 52 |
53 virtual double Duration() const OVERRIDE; | 53 virtual double Duration() const OVERRIDE; |
54 virtual float GetValue(double time) const OVERRIDE; | 54 virtual float GetValue(double time) const OVERRIDE; |
55 | 55 |
56 virtual scoped_ptr<cc::AnimationCurve> Clone() const OVERRIDE; | 56 virtual scoped_ptr<cc::AnimationCurve> Clone() const OVERRIDE; |
57 | 57 |
58 private: | 58 private: |
59 double m_duration; | 59 double duration_; |
60 float m_from; | 60 float from_; |
61 float m_to; | 61 float to_; |
62 }; | 62 }; |
63 | 63 |
64 class FakeLayerAnimationValueObserver : public cc::LayerAnimationValueObserver { | 64 class FakeLayerAnimationValueObserver : public cc::LayerAnimationValueObserver { |
65 public: | 65 public: |
66 FakeLayerAnimationValueObserver(); | 66 FakeLayerAnimationValueObserver(); |
67 virtual ~FakeLayerAnimationValueObserver(); | 67 virtual ~FakeLayerAnimationValueObserver(); |
68 | 68 |
69 // LayerAnimationValueObserver implementation | 69 // LayerAnimationValueObserver implementation |
70 virtual void OnOpacityAnimated(float) OVERRIDE; | 70 virtual void OnOpacityAnimated(float FIXMENAME) OVERRIDE; |
danakj
2013/03/20 23:16:36
fixmenames
| |
71 virtual void OnTransformAnimated(const gfx::Transform&) OVERRIDE; | 71 virtual void OnTransformAnimated(const gfx::Transform& FIXMENAME) OVERRIDE; |
72 virtual bool IsActive() const OVERRIDE; | 72 virtual bool IsActive() const OVERRIDE; |
73 | 73 |
74 float opacity() const { return m_opacity; } | 74 float opacity() const { return opacity_; } |
75 const gfx::Transform& transform() const { return m_transform; } | 75 const gfx::Transform& transform() const { return transform_; } |
76 | 76 |
77 private: | 77 private: |
78 float m_opacity; | 78 float opacity_; |
79 gfx::Transform m_transform; | 79 gfx::Transform transform_; |
80 }; | 80 }; |
81 | 81 |
82 int addOpacityTransitionToController(cc::LayerAnimationController&, double durat ion, float startOpacity, float endOpacity, bool useTimingFunction); | 82 int AddOpacityTransitionToController(cc::LayerAnimationController& FIXMENAME, |
danakj
2013/03/20 23:16:36
and more
| |
83 int addAnimatedTransformToController(cc::LayerAnimationController&, double durat ion, int deltaX, int deltaY); | 83 double duration, |
84 float start_opacity, | |
85 float end_opacity, | |
86 bool use_timing_function); | |
87 int AddAnimatedTransformToController(cc::LayerAnimationController& FIXMENAME, | |
danakj
2013/03/20 23:16:36
also non-const ref's should be turned into pointer
| |
88 double duration, | |
89 int delta_x, | |
90 int delta_y); | |
84 | 91 |
85 int addOpacityTransitionToLayer(cc::Layer&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); | 92 int AddOpacityTransitionToLayer(cc::Layer& FIXMENAME, |
danakj
2013/03/20 23:16:36
also no need for cc::
| |
86 int addOpacityTransitionToLayer(cc::LayerImpl&, double duration, float startOpac ity, float endOpacity, bool useTimingFunction); | 93 double duration, |
94 float start_opacity, | |
95 float end_opacity, | |
96 bool use_timing_function); | |
97 int AddOpacityTransitionToLayer(cc::LayerImpl& FIXMENAME, | |
98 double duration, | |
99 float start_opacity, | |
100 float end_opacity, | |
101 bool use_timing_function); | |
87 | 102 |
88 int addAnimatedTransformToLayer(cc::Layer&, double duration, int deltaX, int del taY); | 103 int AddAnimatedTransformToLayer(cc::Layer& FIXMENAME, |
89 int addAnimatedTransformToLayer(cc::LayerImpl&, double duration, int deltaX, int deltaY); | 104 double duration, |
105 int delta_x, | |
106 int delta_y); | |
107 int AddAnimatedTransformToLayer(cc::LayerImpl& FIXMENAME, | |
108 double duration, | |
109 int delta_x, | |
110 int delta_y); | |
90 | 111 |
91 } // namespace cc | 112 } // namespace cc |
92 | 113 |
93 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ | 114 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ |
OLD | NEW |