Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: cc/test/animation_test_common.h

Issue 2251933002: Fix smooth scroll animation flake on janky pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UpdateTarget while animation is not started Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "cc/animation/element_id.h" 11 #include "cc/animation/element_id.h"
12 #include "cc/animation/transform_operations.h" 12 #include "cc/animation/transform_operations.h"
13 #include "cc/output/filter_operations.h" 13 #include "cc/output/filter_operations.h"
14 #include "cc/test/geometry_test_utils.h" 14 #include "cc/test/geometry_test_utils.h"
15 15
16 namespace cc { 16 namespace cc {
17 class AnimationPlayer; 17 class AnimationPlayer;
18 class ElementAnimations; 18 class ElementAnimations;
19 class LayerImpl; 19 class LayerImpl;
20 class Layer; 20 class Layer;
21 } 21 }
22 22
23 namespace gfx {
24 class ScrollOffset;
25 }
26
23 namespace cc { 27 namespace cc {
24 28
25 class FakeFloatAnimationCurve : public FloatAnimationCurve { 29 class FakeFloatAnimationCurve : public FloatAnimationCurve {
26 public: 30 public:
27 FakeFloatAnimationCurve(); 31 FakeFloatAnimationCurve();
28 explicit FakeFloatAnimationCurve(double duration); 32 explicit FakeFloatAnimationCurve(double duration);
29 ~FakeFloatAnimationCurve() override; 33 ~FakeFloatAnimationCurve() override;
30 34
31 base::TimeDelta Duration() const override; 35 base::TimeDelta Duration() const override;
32 float GetValue(base::TimeDelta now) const override; 36 float GetValue(base::TimeDelta now) const override;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 float GetValue(base::TimeDelta time) const override; 72 float GetValue(base::TimeDelta time) const override;
69 73
70 std::unique_ptr<AnimationCurve> Clone() const override; 74 std::unique_ptr<AnimationCurve> Clone() const override;
71 75
72 private: 76 private:
73 base::TimeDelta duration_; 77 base::TimeDelta duration_;
74 float from_; 78 float from_;
75 float to_; 79 float to_;
76 }; 80 };
77 81
82 int AddScrollOffsetAnimationToElementAnimations(ElementAnimations* target,
83 gfx::ScrollOffset initial_value,
84 gfx::ScrollOffset target_value,
85 bool impl_only);
86
78 int AddOpacityTransitionToElementAnimations(ElementAnimations* target, 87 int AddOpacityTransitionToElementAnimations(ElementAnimations* target,
79 double duration, 88 double duration,
80 float start_opacity, 89 float start_opacity,
81 float end_opacity, 90 float end_opacity,
82 bool use_timing_function); 91 bool use_timing_function);
83 92
84 int AddAnimatedTransformToElementAnimations(ElementAnimations* target, 93 int AddAnimatedTransformToElementAnimations(ElementAnimations* target,
85 double duration, 94 double duration,
86 int delta_x, 95 int delta_x,
87 int delta_y); 96 int delta_y);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 bool use_timing_function); 175 bool use_timing_function);
167 176
168 void AbortAnimationsOnElementWithPlayer( 177 void AbortAnimationsOnElementWithPlayer(
169 ElementId element_id, 178 ElementId element_id,
170 scoped_refptr<AnimationTimeline> timeline, 179 scoped_refptr<AnimationTimeline> timeline,
171 TargetProperty::Type target_property); 180 TargetProperty::Type target_property);
172 181
173 } // namespace cc 182 } // namespace cc
174 183
175 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ 184 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698