OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ | 5 #ifndef CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ |
6 #define CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ | 6 #define CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 std::unique_ptr<TimingFunction> timing_function, | 25 std::unique_ptr<TimingFunction> timing_function, |
26 DurationBehavior = DurationBehavior::DELTA_BASED); | 26 DurationBehavior = DurationBehavior::DELTA_BASED); |
27 | 27 |
28 ~ScrollOffsetAnimationCurve() override; | 28 ~ScrollOffsetAnimationCurve() override; |
29 | 29 |
30 void SetInitialValue(const gfx::ScrollOffset& initial_value); | 30 void SetInitialValue(const gfx::ScrollOffset& initial_value); |
31 bool HasSetInitialValue() const; | 31 bool HasSetInitialValue() const; |
32 gfx::ScrollOffset GetValue(base::TimeDelta t) const; | 32 gfx::ScrollOffset GetValue(base::TimeDelta t) const; |
33 gfx::ScrollOffset target_value() const { return target_value_; } | 33 gfx::ScrollOffset target_value() const { return target_value_; } |
34 void UpdateTarget(double t, const gfx::ScrollOffset& new_target); | 34 void UpdateTarget(double t, const gfx::ScrollOffset& new_target); |
| 35 void ApplyAdjustment(const gfx::Vector2dF& adjustment); |
35 | 36 |
36 // AnimationCurve implementation | 37 // AnimationCurve implementation |
37 base::TimeDelta Duration() const override; | 38 base::TimeDelta Duration() const override; |
38 CurveType Type() const override; | 39 CurveType Type() const override; |
39 std::unique_ptr<AnimationCurve> Clone() const override; | 40 std::unique_ptr<AnimationCurve> Clone() const override; |
40 std::unique_ptr<ScrollOffsetAnimationCurve> | 41 std::unique_ptr<ScrollOffsetAnimationCurve> |
41 CloneToScrollOffsetAnimationCurve() const; | 42 CloneToScrollOffsetAnimationCurve() const; |
42 | 43 |
43 private: | 44 private: |
44 ScrollOffsetAnimationCurve(const gfx::ScrollOffset& target_value, | 45 ScrollOffsetAnimationCurve(const gfx::ScrollOffset& target_value, |
(...skipping 11 matching lines...) Expand all Loading... |
56 DurationBehavior duration_behavior_; | 57 DurationBehavior duration_behavior_; |
57 | 58 |
58 bool has_set_initial_value_; | 59 bool has_set_initial_value_; |
59 | 60 |
60 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); | 61 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); |
61 }; | 62 }; |
62 | 63 |
63 } // namespace cc | 64 } // namespace cc |
64 | 65 |
65 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ | 66 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ |
OLD | NEW |