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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 1534813004: Run smooth scroll animations on the compositor when possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years 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
Index: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
index 77996f3cb6d58c467fcd15caf227d5c546e7f80a..02635bed263571b4cead5bda12dee4e6c0350bf1 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
@@ -454,6 +454,8 @@ void ScrollableArea::layerForScrollingDidChange(WebCompositorAnimationTimeline*
{
if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator())
programmaticScrollAnimator->layerForCompositedScrollingDidChange(timeline);
+ if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator())
+ scrollAnimator->layerForCompositedScrollingDidChange(timeline);
}
bool ScrollableArea::scheduleAnimation()
@@ -469,8 +471,8 @@ void ScrollableArea::serviceScrollAnimations(double monotonicTime)
{
bool requiresAnimationService = false;
if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) {
- scrollAnimator->serviceScrollAnimations();
- if (scrollAnimator->hasRunningAnimation())
+ scrollAnimator->tickAnimation(monotonicTime);
+ if (scrollAnimator->hasAnimationThatRequiresService())
requiresAnimationService = true;
}
if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator()) {
@@ -486,18 +488,24 @@ void ScrollableArea::updateCompositorScrollAnimations()
{
if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator())
programmaticScrollAnimator->updateCompositorAnimations();
+
+ if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator())
+ scrollAnimator->updateCompositorAnimations();
}
void ScrollableArea::notifyCompositorAnimationFinished(int groupId)
{
if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator())
programmaticScrollAnimator->notifyCompositorAnimationFinished(groupId);
+
+ if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator())
+ scrollAnimator->notifyCompositorAnimationFinished(groupId);
}
void ScrollableArea::cancelScrollAnimation()
{
if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator())
- scrollAnimator->cancelAnimations();
+ scrollAnimator->cancelAnimation();
}
void ScrollableArea::cancelProgrammaticScrollAnimation()

Powered by Google App Engine
This is Rietveld 408576698