OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 class ScrollAnimatorTest; | 41 class ScrollAnimatorTest; |
42 | 42 |
43 class PLATFORM_EXPORT ScrollAnimator final : public ScrollAnimatorBase { | 43 class PLATFORM_EXPORT ScrollAnimator final : public ScrollAnimatorBase { |
44 public: | 44 public: |
45 explicit ScrollAnimator(ScrollableArea*, WTF::TimeFunction = WTF::monotonica
llyIncreasingTime); | 45 explicit ScrollAnimator(ScrollableArea*, WTF::TimeFunction = WTF::monotonica
llyIncreasingTime); |
46 ~ScrollAnimator() override; | 46 ~ScrollAnimator() override; |
47 | 47 |
| 48 float computeDeltaToConsume(ScrollbarOrientation, float pixelDelta) const ov
erride; |
| 49 |
48 ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGranularit
y, float step, float delta) override; | 50 ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGranularit
y, float step, float delta) override; |
49 void scrollToOffsetWithoutAnimation(const FloatPoint&) override; | 51 void scrollToOffsetWithoutAnimation(const FloatPoint&) override; |
50 | 52 |
51 void cancelAnimations() override; | 53 void cancelAnimations() override; |
52 void serviceScrollAnimations() override; | 54 void serviceScrollAnimations() override; |
53 bool hasRunningAnimation() const override; | 55 bool hasRunningAnimation() const override; |
54 | 56 |
55 DECLARE_VIRTUAL_TRACE(); | 57 DECLARE_VIRTUAL_TRACE(); |
56 | 58 |
57 protected: | 59 protected: |
58 void animationTimerFired(); | 60 void animationTimerFired(); |
59 | 61 |
60 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; | 62 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; |
61 double m_startTime; | 63 double m_startTime; |
62 WTF::TimeFunction m_timeFunction; | 64 WTF::TimeFunction m_timeFunction; |
| 65 private: |
| 66 FloatPoint desiredTargetPosition() const; |
63 }; | 67 }; |
64 | 68 |
65 } // namespace blink | 69 } // namespace blink |
66 | 70 |
67 #endif // ScrollAnimator_h | 71 #endif // ScrollAnimator_h |
OLD | NEW |