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

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

Issue 802383003: Run CSSOM smooth scroll animations on the compositor when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment Created 5 years, 11 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 | Annotate | Revision Log
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"
(...skipping 11 matching lines...) Expand all
22 WTF_MAKE_NONCOPYABLE(ProgrammaticScrollAnimator); 22 WTF_MAKE_NONCOPYABLE(ProgrammaticScrollAnimator);
23 WTF_MAKE_FAST_ALLOCATED; 23 WTF_MAKE_FAST_ALLOCATED;
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 animateToOffset(FloatPoint); 29 void animateToOffset(FloatPoint);
30 void cancelAnimation(); 30 void cancelAnimation();
31 void tickAnimation(double monotonicTime); 31 void tickAnimation(double monotonicTime);
32 bool hasRunningAnimation() const; 32 bool hasAnimationThatRequiresService() const;
33 void updateCompositorAnimations();
34 void notifyCompositorAnimationFinished(int groupId);
33 35
34 private: 36 private:
35 explicit ProgrammaticScrollAnimator(ScrollableArea*); 37 explicit ProgrammaticScrollAnimator(ScrollableArea*);
36 38
39 enum class RunState {
40 // No animation.
41 Idle,
42
43 // Waiting to send an animation to the compositor. There might also
44 // already be another animation running on the compositor that will need
45 // to be canceled first.
46 WaitingToSendToCompositor,
47
48 // Running an animation on the compositor.
49 RunningOnCompositor,
50
51 // Running an animation on the main thread.
52 RunningOnMainThread,
53
54 // Waiting to cancel the animation currently running on the compositor.
55 // There is no pending animation to replace the canceled animation.
56 WaitingToCancelOnCompositor
57 };
58
37 void resetAnimationState(); 59 void resetAnimationState();
38 60
39 ScrollableArea* m_scrollableArea; 61 ScrollableArea* m_scrollableArea;
40 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; 62 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve;
41 FloatPoint m_targetOffset; 63 FloatPoint m_targetOffset;
42 double m_startTime; 64 double m_startTime;
65 RunState m_runState;
66 int m_compositorAnimationId;
67 int m_compositorAnimationGroupId;
43 }; 68 };
44 69
45 } // namespace blink 70 } // namespace blink
46 71
47 #endif // ProgrammaticScrollAnimator_h 72 #endif // ProgrammaticScrollAnimator_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.cpp ('k') | Source/platform/scroll/ProgrammaticScrollAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698