| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { | 69 class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { |
| 70 public: | 70 public: |
| 71 FakeLayerAnimationValueObserver(); | 71 FakeLayerAnimationValueObserver(); |
| 72 virtual ~FakeLayerAnimationValueObserver(); | 72 virtual ~FakeLayerAnimationValueObserver(); |
| 73 | 73 |
| 74 // LayerAnimationValueObserver implementation | 74 // LayerAnimationValueObserver implementation |
| 75 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; | 75 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; |
| 76 virtual void OnOpacityAnimated(float opacity) OVERRIDE; | 76 virtual void OnOpacityAnimated(float opacity) OVERRIDE; |
| 77 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; | 77 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; |
| 78 virtual void OnScrollOffsetAnimated(gfx::Vector2dF scroll_offset) OVERRIDE; | 78 virtual void OnScrollOffsetAnimated( |
| 79 const gfx::Vector2dF& scroll_offset) OVERRIDE; |
| 79 virtual void OnAnimationWaitingForDeletion() OVERRIDE; | 80 virtual void OnAnimationWaitingForDeletion() OVERRIDE; |
| 80 virtual bool IsActive() const OVERRIDE; | 81 virtual bool IsActive() const OVERRIDE; |
| 81 | 82 |
| 82 const FilterOperations& filters() const { return filters_; } | 83 const FilterOperations& filters() const { return filters_; } |
| 83 float opacity() const { return opacity_; } | 84 float opacity() const { return opacity_; } |
| 84 const gfx::Transform& transform() const { return transform_; } | 85 const gfx::Transform& transform() const { return transform_; } |
| 85 gfx::Vector2dF scroll_offset() { return scroll_offset_; } | 86 gfx::Vector2dF scroll_offset() { return scroll_offset_; } |
| 86 | 87 |
| 87 bool animation_waiting_for_deletion() { | 88 bool animation_waiting_for_deletion() { |
| 88 return animation_waiting_for_deletion_; | 89 return animation_waiting_for_deletion_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 99 class FakeInactiveLayerAnimationValueObserver | 100 class FakeInactiveLayerAnimationValueObserver |
| 100 : public FakeLayerAnimationValueObserver { | 101 : public FakeLayerAnimationValueObserver { |
| 101 public: | 102 public: |
| 102 virtual bool IsActive() const OVERRIDE; | 103 virtual bool IsActive() const OVERRIDE; |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider { | 106 class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider { |
| 106 public: | 107 public: |
| 107 virtual gfx::Vector2dF ScrollOffsetForAnimation() const OVERRIDE; | 108 virtual gfx::Vector2dF ScrollOffsetForAnimation() const OVERRIDE; |
| 108 | 109 |
| 109 void set_scroll_offset(gfx::Vector2dF scroll_offset) { | 110 void set_scroll_offset(const gfx::Vector2dF& scroll_offset) { |
| 110 scroll_offset_ = scroll_offset; | 111 scroll_offset_ = scroll_offset; |
| 111 } | 112 } |
| 112 | 113 |
| 113 private: | 114 private: |
| 114 gfx::Vector2dF scroll_offset_; | 115 gfx::Vector2dF scroll_offset_; |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 int AddOpacityTransitionToController(LayerAnimationController* controller, | 118 int AddOpacityTransitionToController(LayerAnimationController* controller, |
| 118 double duration, | 119 double duration, |
| 119 float start_opacity, | 120 float start_opacity, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 float end_brightness); | 159 float end_brightness); |
| 159 | 160 |
| 160 int AddAnimatedFilterToLayer(LayerImpl* layer, | 161 int AddAnimatedFilterToLayer(LayerImpl* layer, |
| 161 double duration, | 162 double duration, |
| 162 float start_brightness, | 163 float start_brightness, |
| 163 float end_brightness); | 164 float end_brightness); |
| 164 | 165 |
| 165 } // namespace cc | 166 } // namespace cc |
| 166 | 167 |
| 167 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ | 168 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ |
| OLD | NEW |