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 CCAnimationTestCommon_h | 5 #ifndef CCAnimationTestCommon_h |
6 #define CCAnimationTestCommon_h | 6 #define CCAnimationTestCommon_h |
7 | 7 |
8 #include "CCActiveAnimation.h" | 8 #include "CCActiveAnimation.h" |
9 #include "CCAnimationCurve.h" | 9 #include "CCAnimationCurve.h" |
10 #include "CCLayerAnimationController.h" | 10 #include "CCLayerAnimationController.h" |
11 #include "IntSize.h" | 11 #include "IntSize.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 class CCLayerImpl; | 14 class LayerImpl; |
15 class LayerChromium; | 15 class Layer; |
16 } | 16 } |
17 | 17 |
18 namespace WebKitTests { | 18 namespace WebKitTests { |
19 | 19 |
20 class FakeFloatAnimationCurve : public cc::CCFloatAnimationCurve { | 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::CCAnimationCurve> clone() const OVERRIDE; | 28 virtual scoped_ptr<cc::AnimationCurve> clone() const OVERRIDE; |
29 | 29 |
30 private: | 30 private: |
31 double m_duration; | 31 double m_duration; |
32 }; | 32 }; |
33 | 33 |
34 class FakeTransformTransition : public cc::CCTransformAnimationCurve { | 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 WebKit::WebTransformationMatrix getValue(double time) const OVERRIDE
; | 40 virtual WebKit::WebTransformationMatrix getValue(double time) const OVERRIDE
; |
41 | 41 |
42 virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE; | 42 virtual scoped_ptr<cc::AnimationCurve> clone() const OVERRIDE; |
43 | 43 |
44 private: | 44 private: |
45 double m_duration; | 45 double m_duration; |
46 }; | 46 }; |
47 | 47 |
48 class FakeFloatTransition : public cc::CCFloatAnimationCurve { | 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::CCAnimationCurve> clone() const OVERRIDE; | 56 virtual scoped_ptr<cc::AnimationCurve> clone() const OVERRIDE; |
57 | 57 |
58 private: | 58 private: |
59 double m_duration; | 59 double m_duration; |
60 float m_from; | 60 float m_from; |
61 float m_to; | 61 float m_to; |
62 }; | 62 }; |
63 | 63 |
64 class FakeLayerAnimationControllerClient : public cc::CCLayerAnimationController
Client { | 64 class FakeLayerAnimationControllerClient : public cc::LayerAnimationControllerCl
ient { |
65 public: | 65 public: |
66 FakeLayerAnimationControllerClient(); | 66 FakeLayerAnimationControllerClient(); |
67 virtual ~FakeLayerAnimationControllerClient(); | 67 virtual ~FakeLayerAnimationControllerClient(); |
68 | 68 |
69 // CCLayerAnimationControllerClient implementation | 69 // LayerAnimationControllerClient implementation |
70 virtual int id() const OVERRIDE; | 70 virtual int id() const OVERRIDE; |
71 virtual void setOpacityFromAnimation(float) OVERRIDE; | 71 virtual void setOpacityFromAnimation(float) OVERRIDE; |
72 virtual float opacity() const OVERRIDE; | 72 virtual float opacity() const OVERRIDE; |
73 virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix
&) OVERRIDE; | 73 virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix
&) OVERRIDE; |
74 virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE; | 74 virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE; |
75 | 75 |
76 private: | 76 private: |
77 float m_opacity; | 77 float m_opacity; |
78 WebKit::WebTransformationMatrix m_transform; | 78 WebKit::WebTransformationMatrix m_transform; |
79 }; | 79 }; |
80 | 80 |
81 void addOpacityTransitionToController(cc::CCLayerAnimationController&, double du
ration, float startOpacity, float endOpacity, bool useTimingFunction); | 81 void addOpacityTransitionToController(cc::LayerAnimationController&, double dura
tion, float startOpacity, float endOpacity, bool useTimingFunction); |
82 void addAnimatedTransformToController(cc::CCLayerAnimationController&, double du
ration, int deltaX, int deltaY); | 82 void addAnimatedTransformToController(cc::LayerAnimationController&, double dura
tion, int deltaX, int deltaY); |
83 | 83 |
84 void addOpacityTransitionToLayer(cc::LayerChromium&, double duration, float star
tOpacity, float endOpacity, bool useTimingFunction); | 84 void addOpacityTransitionToLayer(cc::Layer&, double duration, float startOpacity
, float endOpacity, bool useTimingFunction); |
85 void addOpacityTransitionToLayer(cc::CCLayerImpl&, double duration, float startO
pacity, float endOpacity, bool useTimingFunction); | 85 void addOpacityTransitionToLayer(cc::LayerImpl&, double duration, float startOpa
city, float endOpacity, bool useTimingFunction); |
86 | 86 |
87 void addAnimatedTransformToLayer(cc::LayerChromium&, double duration, int deltaX
, int deltaY); | 87 void addAnimatedTransformToLayer(cc::Layer&, double duration, int deltaX, int de
ltaY); |
88 void addAnimatedTransformToLayer(cc::CCLayerImpl&, double duration, int deltaX,
int deltaY); | 88 void addAnimatedTransformToLayer(cc::LayerImpl&, double duration, int deltaX, in
t deltaY); |
89 | 89 |
90 } // namespace WebKitTests | 90 } // namespace WebKitTests |
91 | 91 |
92 #endif // CCAnimationTesctCommon_h | 92 #endif // CCAnimationTesctCommon_h |
OLD | NEW |