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