| 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/animation_timeline.h" | 10 #include "cc/animation/animation_timeline.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 namespace cc { | 24 namespace cc { |
| 25 | 25 |
| 26 class FakeFloatAnimationCurve : public FloatAnimationCurve { | 26 class FakeFloatAnimationCurve : public FloatAnimationCurve { |
| 27 public: | 27 public: |
| 28 FakeFloatAnimationCurve(); | 28 FakeFloatAnimationCurve(); |
| 29 explicit FakeFloatAnimationCurve(double duration); | 29 explicit FakeFloatAnimationCurve(double duration); |
| 30 ~FakeFloatAnimationCurve() override; | 30 ~FakeFloatAnimationCurve() override; |
| 31 | 31 |
| 32 base::TimeDelta Duration() const override; | 32 base::TimeDelta Duration() const override; |
| 33 float GetValue(base::TimeDelta now) const override; | 33 float GetValue(base::TimeDelta now) const override; |
| 34 scoped_ptr<AnimationCurve> Clone() const override; | 34 std::unique_ptr<AnimationCurve> Clone() const override; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 base::TimeDelta duration_; | 37 base::TimeDelta duration_; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class FakeTransformTransition : public TransformAnimationCurve { | 40 class FakeTransformTransition : public TransformAnimationCurve { |
| 41 public: | 41 public: |
| 42 explicit FakeTransformTransition(double duration); | 42 explicit FakeTransformTransition(double duration); |
| 43 ~FakeTransformTransition() override; | 43 ~FakeTransformTransition() override; |
| 44 | 44 |
| 45 base::TimeDelta Duration() const override; | 45 base::TimeDelta Duration() const override; |
| 46 gfx::Transform GetValue(base::TimeDelta time) const override; | 46 gfx::Transform GetValue(base::TimeDelta time) const override; |
| 47 bool AnimatedBoundsForBox(const gfx::BoxF& box, | 47 bool AnimatedBoundsForBox(const gfx::BoxF& box, |
| 48 gfx::BoxF* bounds) const override; | 48 gfx::BoxF* bounds) const override; |
| 49 bool AffectsScale() const override; | 49 bool AffectsScale() const override; |
| 50 bool IsTranslation() const override; | 50 bool IsTranslation() const override; |
| 51 bool PreservesAxisAlignment() const override; | 51 bool PreservesAxisAlignment() const override; |
| 52 bool AnimationStartScale(bool forward_direction, | 52 bool AnimationStartScale(bool forward_direction, |
| 53 float* start_scale) const override; | 53 float* start_scale) const override; |
| 54 bool MaximumTargetScale(bool forward_direction, | 54 bool MaximumTargetScale(bool forward_direction, |
| 55 float* max_scale) const override; | 55 float* max_scale) const override; |
| 56 | 56 |
| 57 scoped_ptr<AnimationCurve> Clone() const override; | 57 std::unique_ptr<AnimationCurve> Clone() const override; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 base::TimeDelta duration_; | 60 base::TimeDelta duration_; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class FakeFloatTransition : public FloatAnimationCurve { | 63 class FakeFloatTransition : public FloatAnimationCurve { |
| 64 public: | 64 public: |
| 65 FakeFloatTransition(double duration, float from, float to); | 65 FakeFloatTransition(double duration, float from, float to); |
| 66 ~FakeFloatTransition() override; | 66 ~FakeFloatTransition() override; |
| 67 | 67 |
| 68 base::TimeDelta Duration() const override; | 68 base::TimeDelta Duration() const override; |
| 69 float GetValue(base::TimeDelta time) const override; | 69 float GetValue(base::TimeDelta time) const override; |
| 70 | 70 |
| 71 scoped_ptr<AnimationCurve> Clone() const override; | 71 std::unique_ptr<AnimationCurve> Clone() const override; |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 base::TimeDelta duration_; | 74 base::TimeDelta duration_; |
| 75 float from_; | 75 float from_; |
| 76 float to_; | 76 float to_; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { | 79 class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { |
| 80 public: | 80 public: |
| 81 FakeLayerAnimationValueObserver(); | 81 FakeLayerAnimationValueObserver(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 float end_brightness); | 166 float end_brightness); |
| 167 | 167 |
| 168 int AddOpacityStepsToController(LayerAnimationController* target, | 168 int AddOpacityStepsToController(LayerAnimationController* target, |
| 169 double duration, | 169 double duration, |
| 170 float start_opacity, | 170 float start_opacity, |
| 171 float end_opacity, | 171 float end_opacity, |
| 172 int num_steps); | 172 int num_steps); |
| 173 | 173 |
| 174 void AddAnimationToLayerWithPlayer(int layer_id, | 174 void AddAnimationToLayerWithPlayer(int layer_id, |
| 175 scoped_refptr<AnimationTimeline> timeline, | 175 scoped_refptr<AnimationTimeline> timeline, |
| 176 scoped_ptr<Animation> animation); | 176 std::unique_ptr<Animation> animation); |
| 177 void AddAnimationToLayerWithExistingPlayer( | 177 void AddAnimationToLayerWithExistingPlayer( |
| 178 int layer_id, | 178 int layer_id, |
| 179 scoped_refptr<AnimationTimeline> timeline, | 179 scoped_refptr<AnimationTimeline> timeline, |
| 180 scoped_ptr<Animation> animation); | 180 std::unique_ptr<Animation> animation); |
| 181 | 181 |
| 182 void RemoveAnimationFromLayerWithExistingPlayer( | 182 void RemoveAnimationFromLayerWithExistingPlayer( |
| 183 int layer_id, | 183 int layer_id, |
| 184 scoped_refptr<AnimationTimeline> timeline, | 184 scoped_refptr<AnimationTimeline> timeline, |
| 185 int animation_id); | 185 int animation_id); |
| 186 | 186 |
| 187 Animation* GetAnimationFromLayerWithExistingPlayer( | 187 Animation* GetAnimationFromLayerWithExistingPlayer( |
| 188 int layer_id, | 188 int layer_id, |
| 189 scoped_refptr<AnimationTimeline> timeline, | 189 scoped_refptr<AnimationTimeline> timeline, |
| 190 int animation_id); | 190 int animation_id); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 218 float end_opacity, | 218 float end_opacity, |
| 219 bool use_timing_function); | 219 bool use_timing_function); |
| 220 | 220 |
| 221 void AbortAnimationsOnLayerWithPlayer(int layer_id, | 221 void AbortAnimationsOnLayerWithPlayer(int layer_id, |
| 222 scoped_refptr<AnimationTimeline> timeline, | 222 scoped_refptr<AnimationTimeline> timeline, |
| 223 TargetProperty::Type target_property); | 223 TargetProperty::Type target_property); |
| 224 | 224 |
| 225 } // namespace cc | 225 } // namespace cc |
| 226 | 226 |
| 227 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ | 227 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ |
| OLD | NEW |