Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: Source/platform/scroll/ProgrammaticScrollAnimator.h

Issue 1173053003: Remove ScrollableArea::notifyScrollPositionChanged and cleanup scroll animators. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase + remove updateScrollbars from FrameView::setScrollPosition Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "wtf/FastAllocBase.h" 9 #include "wtf/FastAllocBase.h"
10 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
11 #include "wtf/OwnPtr.h" 11 #include "wtf/OwnPtr.h"
12 #include "wtf/PassOwnPtr.h" 12 #include "wtf/PassOwnPtr.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class ScrollableArea; 16 class ScrollableArea;
17 class WebScrollOffsetAnimationCurve; 17 class WebScrollOffsetAnimationCurve;
18 18
19 // Animator for fixed-destination scrolls, such as those triggered by 19 // Animator for fixed-destination scrolls, such as those triggered by
20 // CSSOM View scroll APIs. 20 // CSSOM View scroll APIs.
21 class ProgrammaticScrollAnimator { 21 class ProgrammaticScrollAnimator {
22 WTF_MAKE_NONCOPYABLE(ProgrammaticScrollAnimator); 22 WTF_MAKE_NONCOPYABLE(ProgrammaticScrollAnimator);
23 WTF_MAKE_FAST_ALLOCATED(ProgrammaticScrollAnimator); 23 WTF_MAKE_FAST_ALLOCATED(ProgrammaticScrollAnimator);
24 public: 24 public:
25 static PassOwnPtr<ProgrammaticScrollAnimator> create(ScrollableArea*); 25 static PassOwnPtr<ProgrammaticScrollAnimator> create(ScrollableArea*);
26 26
27 ~ProgrammaticScrollAnimator(); 27 ~ProgrammaticScrollAnimator();
28 28
29 void scrollToOffsetWithoutAnimation(const FloatPoint&);
29 void animateToOffset(FloatPoint); 30 void animateToOffset(FloatPoint);
30 void cancelAnimation(); 31 void cancelAnimation();
31 void tickAnimation(double monotonicTime); 32 void tickAnimation(double monotonicTime);
32 bool hasAnimationThatRequiresService() const; 33 bool hasAnimationThatRequiresService() const;
33 void updateCompositorAnimations(); 34 void updateCompositorAnimations();
34 void layerForCompositedScrollingDidChange(); 35 void layerForCompositedScrollingDidChange();
35 void notifyCompositorAnimationFinished(int groupId); 36 void notifyCompositorAnimationFinished(int groupId);
36 37
37 private: 38 private:
38 explicit ProgrammaticScrollAnimator(ScrollableArea*); 39 explicit ProgrammaticScrollAnimator(ScrollableArea*);
(...skipping 12 matching lines...) Expand all
51 52
52 // Running an animation on the main thread. 53 // Running an animation on the main thread.
53 RunningOnMainThread, 54 RunningOnMainThread,
54 55
55 // Waiting to cancel the animation currently running on the compositor. 56 // Waiting to cancel the animation currently running on the compositor.
56 // There is no pending animation to replace the canceled animation. 57 // There is no pending animation to replace the canceled animation.
57 WaitingToCancelOnCompositor 58 WaitingToCancelOnCompositor
58 }; 59 };
59 60
60 void resetAnimationState(); 61 void resetAnimationState();
62 void notifyPositionChanged(const DoublePoint&);
61 63
62 ScrollableArea* m_scrollableArea; 64 ScrollableArea* m_scrollableArea;
63 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; 65 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve;
64 FloatPoint m_targetOffset; 66 FloatPoint m_targetOffset;
65 double m_startTime; 67 double m_startTime;
66 RunState m_runState; 68 RunState m_runState;
67 int m_compositorAnimationId; 69 int m_compositorAnimationId;
68 int m_compositorAnimationGroupId; 70 int m_compositorAnimationGroupId;
69 }; 71 };
70 72
71 } // namespace blink 73 } // namespace blink
72 74
73 #endif // ProgrammaticScrollAnimator_h 75 #endif // ProgrammaticScrollAnimator_h
OLDNEW
« no previous file with comments | « Source/platform/mac/ScrollAnimatorMac.mm ('k') | Source/platform/scroll/ProgrammaticScrollAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698