| 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/active_animation.h" | 8 #include "cc/active_animation.h" |
| 9 #include "cc/animation_curve.h" | 9 #include "cc/animation_curve.h" |
| 10 #include "cc/layer_animation_controller.h" | 10 #include "cc/layer_animation_controller.h" |
| 11 #include "cc/layer_animation_value_observer.h" |
| 11 | 12 |
| 12 namespace cc { | 13 namespace cc { |
| 13 class LayerImpl; | 14 class LayerImpl; |
| 14 class Layer; | 15 class Layer; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace cc { | 18 namespace cc { |
| 18 | 19 |
| 19 class FakeFloatAnimationCurve : public cc::FloatAnimationCurve { | 20 class FakeFloatAnimationCurve : public cc::FloatAnimationCurve { |
| 20 public: | 21 public: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 virtual float getValue(double time) const OVERRIDE; | 54 virtual float getValue(double time) const OVERRIDE; |
| 54 | 55 |
| 55 virtual scoped_ptr<cc::AnimationCurve> clone() const OVERRIDE; | 56 virtual scoped_ptr<cc::AnimationCurve> clone() const OVERRIDE; |
| 56 | 57 |
| 57 private: | 58 private: |
| 58 double m_duration; | 59 double m_duration; |
| 59 float m_from; | 60 float m_from; |
| 60 float m_to; | 61 float m_to; |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 class FakeLayerAnimationControllerClient : public cc::LayerAnimationControllerCl
ient { | 64 class FakeLayerAnimationValueObserver : public cc::LayerAnimationValueObserver { |
| 64 public: | 65 public: |
| 65 FakeLayerAnimationControllerClient(); | 66 FakeLayerAnimationValueObserver(); |
| 66 virtual ~FakeLayerAnimationControllerClient(); | 67 virtual ~FakeLayerAnimationValueObserver(); |
| 67 | 68 |
| 68 // LayerAnimationControllerClient implementation | 69 // LayerAnimationValueObserver implementation |
| 69 virtual int id() const OVERRIDE; | 70 virtual void OnOpacityAnimated(float) OVERRIDE; |
| 70 virtual void setOpacityFromAnimation(float) OVERRIDE; | 71 virtual void OnTransformAnimated(const gfx::Transform&) OVERRIDE; |
| 71 virtual float opacity() const OVERRIDE; | 72 |
| 72 virtual void setTransformFromAnimation(const gfx::Transform&) OVERRIDE; | 73 float opacity() const { return m_opacity; } |
| 73 virtual const gfx::Transform& transform() const OVERRIDE; | 74 const gfx::Transform& transform() const { return m_transform; } |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 float m_opacity; | 77 float m_opacity; |
| 77 gfx::Transform m_transform; | 78 gfx::Transform m_transform; |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 int addOpacityTransitionToController(cc::LayerAnimationController&, double durat
ion, float startOpacity, float endOpacity, bool useTimingFunction); | 81 int addOpacityTransitionToController(cc::LayerAnimationController&, double durat
ion, float startOpacity, float endOpacity, bool useTimingFunction); |
| 81 int addAnimatedTransformToController(cc::LayerAnimationController&, double durat
ion, int deltaX, int deltaY); | 82 int addAnimatedTransformToController(cc::LayerAnimationController&, double durat
ion, int deltaX, int deltaY); |
| 82 | 83 |
| 83 int addOpacityTransitionToLayer(cc::Layer&, double duration, float startOpacity,
float endOpacity, bool useTimingFunction); | 84 int addOpacityTransitionToLayer(cc::Layer&, double duration, float startOpacity,
float endOpacity, bool useTimingFunction); |
| 84 int addOpacityTransitionToLayer(cc::LayerImpl&, double duration, float startOpac
ity, float endOpacity, bool useTimingFunction); | 85 int addOpacityTransitionToLayer(cc::LayerImpl&, double duration, float startOpac
ity, float endOpacity, bool useTimingFunction); |
| 85 | 86 |
| 86 int addAnimatedTransformToLayer(cc::Layer&, double duration, int deltaX, int del
taY); | 87 int addAnimatedTransformToLayer(cc::Layer&, double duration, int deltaX, int del
taY); |
| 87 int addAnimatedTransformToLayer(cc::LayerImpl&, double duration, int deltaX, int
deltaY); | 88 int addAnimatedTransformToLayer(cc::LayerImpl&, double duration, int deltaX, int
deltaY); |
| 88 | 89 |
| 89 } // namespace cc | 90 } // namespace cc |
| 90 | 91 |
| 91 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ | 92 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ |
| OLD | NEW |