| 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" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { | 72 class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { |
| 73 public: | 73 public: |
| 74 FakeLayerAnimationValueObserver(); | 74 FakeLayerAnimationValueObserver(); |
| 75 virtual ~FakeLayerAnimationValueObserver(); | 75 virtual ~FakeLayerAnimationValueObserver(); |
| 76 | 76 |
| 77 // LayerAnimationValueObserver implementation | 77 // LayerAnimationValueObserver implementation |
| 78 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; | 78 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; |
| 79 virtual void OnOpacityAnimated(float opacity) OVERRIDE; | 79 virtual void OnOpacityAnimated(float opacity) OVERRIDE; |
| 80 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; | 80 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; |
| 81 virtual void OnScrollOffsetAnimated( | 81 virtual void OnScrollOffsetAnimated( |
| 82 const gfx::Vector2dF& scroll_offset) OVERRIDE; | 82 const gfx::ScrollOffset& scroll_offset) OVERRIDE; |
| 83 virtual void OnAnimationWaitingForDeletion() OVERRIDE; | 83 virtual void OnAnimationWaitingForDeletion() OVERRIDE; |
| 84 virtual bool IsActive() const OVERRIDE; | 84 virtual bool IsActive() const OVERRIDE; |
| 85 | 85 |
| 86 const FilterOperations& filters() const { return filters_; } | 86 const FilterOperations& filters() const { return filters_; } |
| 87 float opacity() const { return opacity_; } | 87 float opacity() const { return opacity_; } |
| 88 const gfx::Transform& transform() const { return transform_; } | 88 const gfx::Transform& transform() const { return transform_; } |
| 89 gfx::Vector2dF scroll_offset() { return scroll_offset_; } | 89 gfx::ScrollOffset scroll_offset() { return scroll_offset_; } |
| 90 | 90 |
| 91 bool animation_waiting_for_deletion() { | 91 bool animation_waiting_for_deletion() { |
| 92 return animation_waiting_for_deletion_; | 92 return animation_waiting_for_deletion_; |
| 93 } | 93 } |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 FilterOperations filters_; | 96 FilterOperations filters_; |
| 97 float opacity_; | 97 float opacity_; |
| 98 gfx::Transform transform_; | 98 gfx::Transform transform_; |
| 99 gfx::Vector2dF scroll_offset_; | 99 gfx::ScrollOffset scroll_offset_; |
| 100 bool animation_waiting_for_deletion_; | 100 bool animation_waiting_for_deletion_; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 class FakeInactiveLayerAnimationValueObserver | 103 class FakeInactiveLayerAnimationValueObserver |
| 104 : public FakeLayerAnimationValueObserver { | 104 : public FakeLayerAnimationValueObserver { |
| 105 public: | 105 public: |
| 106 virtual bool IsActive() const OVERRIDE; | 106 virtual bool IsActive() const OVERRIDE; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider { | 109 class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider { |
| 110 public: | 110 public: |
| 111 virtual gfx::Vector2dF ScrollOffsetForAnimation() const OVERRIDE; | 111 virtual gfx::ScrollOffset ScrollOffsetForAnimation() const OVERRIDE; |
| 112 | 112 |
| 113 void set_scroll_offset(const gfx::Vector2dF& scroll_offset) { | 113 void set_scroll_offset(const gfx::ScrollOffset& scroll_offset) { |
| 114 scroll_offset_ = scroll_offset; | 114 scroll_offset_ = scroll_offset; |
| 115 } | 115 } |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 gfx::Vector2dF scroll_offset_; | 118 gfx::ScrollOffset scroll_offset_; |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 int AddOpacityTransitionToController(LayerAnimationController* controller, | 121 int AddOpacityTransitionToController(LayerAnimationController* controller, |
| 122 double duration, | 122 double duration, |
| 123 float start_opacity, | 123 float start_opacity, |
| 124 float end_opacity, | 124 float end_opacity, |
| 125 bool use_timing_function); | 125 bool use_timing_function); |
| 126 | 126 |
| 127 int AddAnimatedTransformToController(LayerAnimationController* controller, | 127 int AddAnimatedTransformToController(LayerAnimationController* controller, |
| 128 double duration, | 128 double duration, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 float end_brightness); | 172 float end_brightness); |
| 173 | 173 |
| 174 int AddAnimatedFilterToLayer(LayerImpl* layer, | 174 int AddAnimatedFilterToLayer(LayerImpl* layer, |
| 175 double duration, | 175 double duration, |
| 176 float start_brightness, | 176 float start_brightness, |
| 177 float end_brightness); | 177 float end_brightness); |
| 178 | 178 |
| 179 } // namespace cc | 179 } // namespace cc |
| 180 | 180 |
| 181 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ | 181 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ |
| OLD | NEW |