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

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

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/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollableArea.cpp
diff --git a/Source/platform/scroll/ScrollableArea.cpp b/Source/platform/scroll/ScrollableArea.cpp
index 060567b1b789b7362d8b5ac03b3071669edce61a..e19981913fb905222548ca6abfdba67f50c58e07 100644
--- a/Source/platform/scroll/ScrollableArea.cpp
+++ b/Source/platform/scroll/ScrollableArea.cpp
@@ -159,9 +159,10 @@ bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granula
return scrollAnimator()->scroll(orientation, granularity, step, delta);
}
-void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, bool cancelProgrammaticAnimations)
{
- cancelProgrammaticScrollAnimation();
+ if (cancelProgrammaticAnimations)
+ cancelProgrammaticScrollAnimation();
scrollAnimator()->scrollToOffsetWithoutAnimation(offset);
}
@@ -430,21 +431,33 @@ bool ScrollableArea::scheduleAnimation()
void ScrollableArea::serviceScrollAnimations(double monotonicTime)
{
- bool hasRunningAnimation = false;
+ bool requiresAnimationService = false;
if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) {
scrollAnimator->serviceScrollAnimations();
if (scrollAnimator->hasRunningAnimation())
- hasRunningAnimation = true;
+ requiresAnimationService = true;
}
if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator()) {
programmaticScrollAnimator->tickAnimation(monotonicTime);
- if (programmaticScrollAnimator->hasRunningAnimation())
- hasRunningAnimation = true;
+ if (programmaticScrollAnimator->hasAnimationThatRequiresService())
+ requiresAnimationService = true;
}
- if (!hasRunningAnimation)
+ if (!requiresAnimationService)
deregisterForAnimation();
}
+void ScrollableArea::updateCompositorScrollAnimations()
+{
+ if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator())
+ programmaticScrollAnimator->updateCompositorAnimations();
+}
+
+void ScrollableArea::notifyCompositorAnimationFinished(int groupId)
+{
+ if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator())
+ programmaticScrollAnimator->notifyCompositorAnimationFinished(groupId);
+}
+
void ScrollableArea::cancelProgrammaticScrollAnimation()
{
if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator())
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698