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" |
11 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
12 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
13 #include "wtf/OwnPtr.h" | 13 #include <memory> |
14 #include "wtf/PassOwnPtr.h" | |
15 | 14 |
16 namespace blink { | 15 namespace blink { |
17 | 16 |
18 class ScrollableArea; | 17 class ScrollableArea; |
19 class CompositorAnimationTimeline; | 18 class CompositorAnimationTimeline; |
20 class CompositorScrollOffsetAnimationCurve; | 19 class CompositorScrollOffsetAnimationCurve; |
21 | 20 |
22 // Animator for fixed-destination scrolls, such as those triggered by | 21 // Animator for fixed-destination scrolls, such as those triggered by |
23 // CSSOM View scroll APIs. | 22 // CSSOM View scroll APIs. |
24 class ProgrammaticScrollAnimator : public ScrollAnimatorCompositorCoordinator { | 23 class ProgrammaticScrollAnimator : public ScrollAnimatorCompositorCoordinator { |
(...skipping 21 matching lines...) Expand all Loading... |
46 void layerForCompositedScrollingDidChange(CompositorAnimationTimeline*) over
ride; | 45 void layerForCompositedScrollingDidChange(CompositorAnimationTimeline*) over
ride; |
47 | 46 |
48 DECLARE_TRACE(); | 47 DECLARE_TRACE(); |
49 | 48 |
50 private: | 49 private: |
51 explicit ProgrammaticScrollAnimator(ScrollableArea*); | 50 explicit ProgrammaticScrollAnimator(ScrollableArea*); |
52 | 51 |
53 void notifyPositionChanged(const DoublePoint&); | 52 void notifyPositionChanged(const DoublePoint&); |
54 | 53 |
55 Member<ScrollableArea> m_scrollableArea; | 54 Member<ScrollableArea> m_scrollableArea; |
56 OwnPtr<CompositorScrollOffsetAnimationCurve> m_animationCurve; | 55 std::unique_ptr<CompositorScrollOffsetAnimationCurve> m_animationCurve; |
57 FloatPoint m_targetOffset; | 56 FloatPoint m_targetOffset; |
58 double m_startTime; | 57 double m_startTime; |
59 }; | 58 }; |
60 | 59 |
61 } // namespace blink | 60 } // namespace blink |
62 | 61 |
63 #endif // ProgrammaticScrollAnimator_h | 62 #endif // ProgrammaticScrollAnimator_h |
OLD | NEW |