OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ProgrammaticScrollAnimator_h | 5 #ifndef ProgrammaticScrollAnimator_h |
6 #define ProgrammaticScrollAnimator_h | 6 #define ProgrammaticScrollAnimator_h |
7 | 7 |
8 #include "platform/geometry/FloatPoint.h" | 8 #include "platform/geometry/FloatPoint.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "platform/scroll/ScrollAnimatorCompositorCoordinator.h" | 10 #include "platform/scroll/ScrollAnimatorCompositorCoordinator.h" |
(...skipping 16 matching lines...) Loading... |
27 public: | 27 public: |
28 static PassOwnPtrWillBeRawPtr<ProgrammaticScrollAnimator> create(ScrollableA
rea*); | 28 static PassOwnPtrWillBeRawPtr<ProgrammaticScrollAnimator> create(ScrollableA
rea*); |
29 | 29 |
30 virtual ~ProgrammaticScrollAnimator(); | 30 virtual ~ProgrammaticScrollAnimator(); |
31 | 31 |
32 void scrollToOffsetWithoutAnimation(const FloatPoint&); | 32 void scrollToOffsetWithoutAnimation(const FloatPoint&); |
33 void animateToOffset(FloatPoint); | 33 void animateToOffset(FloatPoint); |
34 | 34 |
35 // ScrollAnimatorCompositorCoordinator implementation. | 35 // ScrollAnimatorCompositorCoordinator implementation. |
36 void resetAnimationState() override; | 36 void resetAnimationState() override; |
37 void cancelAnimation() override; | |
38 ScrollableArea* scrollableArea() const override { return m_scrollableArea; } | 37 ScrollableArea* scrollableArea() const override { return m_scrollableArea; } |
39 void tickAnimation(double monotonicTime) override; | 38 void tickAnimation(double monotonicTime) override; |
40 void updateCompositorAnimations() override; | 39 void updateCompositorAnimations() override; |
41 void notifyCompositorAnimationFinished(int groupId) override; | 40 void notifyCompositorAnimationFinished(int groupId) override; |
42 void layerForCompositedScrollingDidChange(WebCompositorAnimationTimeline*) o
verride; | 41 void layerForCompositedScrollingDidChange(WebCompositorAnimationTimeline*) o
verride; |
43 | 42 |
44 DECLARE_TRACE(); | 43 DECLARE_TRACE(); |
45 | 44 |
46 private: | 45 private: |
47 explicit ProgrammaticScrollAnimator(ScrollableArea*); | 46 explicit ProgrammaticScrollAnimator(ScrollableArea*); |
48 | 47 |
49 void notifyPositionChanged(const DoublePoint&); | 48 void notifyPositionChanged(const DoublePoint&); |
50 | 49 |
51 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; | 50 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; |
52 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; | 51 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; |
53 FloatPoint m_targetOffset; | 52 FloatPoint m_targetOffset; |
54 double m_startTime; | 53 double m_startTime; |
55 }; | 54 }; |
56 | 55 |
57 } // namespace blink | 56 } // namespace blink |
58 | 57 |
59 #endif // ProgrammaticScrollAnimator_h | 58 #endif // ProgrammaticScrollAnimator_h |
OLD | NEW |