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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 public: | 75 public: |
76 FakeLayerAnimationValueObserver(); | 76 FakeLayerAnimationValueObserver(); |
77 ~FakeLayerAnimationValueObserver() override; | 77 ~FakeLayerAnimationValueObserver() override; |
78 | 78 |
79 // LayerAnimationValueObserver implementation | 79 // LayerAnimationValueObserver implementation |
80 void OnFilterAnimated(const FilterOperations& filters) override; | 80 void OnFilterAnimated(const FilterOperations& filters) override; |
81 void OnOpacityAnimated(float opacity) override; | 81 void OnOpacityAnimated(float opacity) override; |
82 void OnTransformAnimated(const gfx::Transform& transform) override; | 82 void OnTransformAnimated(const gfx::Transform& transform) override; |
83 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override; | 83 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override; |
84 void OnAnimationWaitingForDeletion() override; | 84 void OnAnimationWaitingForDeletion() override; |
85 void OnScrollOffsetAnimationRemoved() override; | |
86 bool IsActive() const override; | 85 bool IsActive() const override; |
87 | 86 |
88 const FilterOperations& filters() const { return filters_; } | 87 const FilterOperations& filters() const { return filters_; } |
89 float opacity() const { return opacity_; } | 88 float opacity() const { return opacity_; } |
90 const gfx::Transform& transform() const { return transform_; } | 89 const gfx::Transform& transform() const { return transform_; } |
91 gfx::ScrollOffset scroll_offset() { return scroll_offset_; } | 90 gfx::ScrollOffset scroll_offset() { return scroll_offset_; } |
92 | 91 |
93 bool animation_waiting_for_deletion() { | 92 bool animation_waiting_for_deletion() { |
94 return animation_waiting_for_deletion_; | 93 return animation_waiting_for_deletion_; |
95 } | 94 } |
96 | 95 |
97 bool scroll_offset_animation_removed() const { | |
98 return scroll_offset_animation_removed_; | |
99 } | |
100 void reset_scroll_offset_animation_removed() { | |
101 scroll_offset_animation_removed_ = false; | |
102 } | |
103 | |
104 private: | 96 private: |
105 FilterOperations filters_; | 97 FilterOperations filters_; |
106 float opacity_; | 98 float opacity_; |
107 gfx::Transform transform_; | 99 gfx::Transform transform_; |
108 gfx::ScrollOffset scroll_offset_; | 100 gfx::ScrollOffset scroll_offset_; |
109 bool animation_waiting_for_deletion_; | 101 bool animation_waiting_for_deletion_; |
110 bool scroll_offset_animation_removed_; | |
111 }; | 102 }; |
112 | 103 |
113 class FakeInactiveLayerAnimationValueObserver | 104 class FakeInactiveLayerAnimationValueObserver |
114 : public FakeLayerAnimationValueObserver { | 105 : public FakeLayerAnimationValueObserver { |
115 public: | 106 public: |
116 bool IsActive() const override; | 107 bool IsActive() const override; |
117 }; | 108 }; |
118 | 109 |
119 class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider { | 110 class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider { |
120 public: | 111 public: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 float end_brightness); | 173 float end_brightness); |
183 | 174 |
184 int AddAnimatedFilterToLayer(LayerImpl* layer, | 175 int AddAnimatedFilterToLayer(LayerImpl* layer, |
185 double duration, | 176 double duration, |
186 float start_brightness, | 177 float start_brightness, |
187 float end_brightness); | 178 float end_brightness); |
188 | 179 |
189 } // namespace cc | 180 } // namespace cc |
190 | 181 |
191 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ | 182 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ |
OLD | NEW |