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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.cpp ('k') | Source/platform/scroll/ProgrammaticScrollAnimator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ProgrammaticScrollAnimator.h
diff --git a/Source/platform/scroll/ProgrammaticScrollAnimator.h b/Source/platform/scroll/ProgrammaticScrollAnimator.h
index a37d9b374e94d6de1965a405b53f6586abea54c7..538077d0394922f78c6f2726bb27e2dacafaf276 100644
--- a/Source/platform/scroll/ProgrammaticScrollAnimator.h
+++ b/Source/platform/scroll/ProgrammaticScrollAnimator.h
@@ -29,17 +29,42 @@ public:
void animateToOffset(FloatPoint);
void cancelAnimation();
void tickAnimation(double monotonicTime);
- bool hasRunningAnimation() const;
+ bool hasAnimationThatRequiresService() const;
+ void updateCompositorAnimations();
+ void notifyCompositorAnimationFinished(int groupId);
private:
explicit ProgrammaticScrollAnimator(ScrollableArea*);
+ enum class RunState {
+ // No animation.
+ Idle,
+
+ // Waiting to send an animation to the compositor. There might also
+ // already be another animation running on the compositor that will need
+ // to be canceled first.
+ WaitingToSendToCompositor,
+
+ // Running an animation on the compositor.
+ RunningOnCompositor,
+
+ // Running an animation on the main thread.
+ RunningOnMainThread,
+
+ // Waiting to cancel the animation currently running on the compositor.
+ // There is no pending animation to replace the canceled animation.
+ WaitingToCancelOnCompositor
+ };
+
void resetAnimationState();
ScrollableArea* m_scrollableArea;
OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve;
FloatPoint m_targetOffset;
double m_startTime;
+ RunState m_runState;
+ int m_compositorAnimationId;
+ int m_compositorAnimationGroupId;
};
} // namespace blink
« 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