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

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

Issue 871013005: Notify ProgrammaticScrollAnimator about scroll layer destruction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/ProgrammaticScrollAnimator.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ProgrammaticScrollAnimator.cpp
diff --git a/Source/platform/scroll/ProgrammaticScrollAnimator.cpp b/Source/platform/scroll/ProgrammaticScrollAnimator.cpp
index 7b2332936a21758aa06070ec8d54633bc147ff9b..f43c914e7f26554dd007de4f90cba4497b448fca 100644
--- a/Source/platform/scroll/ProgrammaticScrollAnimator.cpp
+++ b/Source/platform/scroll/ProgrammaticScrollAnimator.cpp
@@ -163,6 +163,23 @@ void ProgrammaticScrollAnimator::updateCompositorAnimations()
}
}
+void ProgrammaticScrollAnimator::layerForCompositedScrollingDidChange()
+{
+ // If the composited scrolling layer is lost during a composited animation,
+ // continue the animation on the main thread.
+ if (m_runState == RunState::RunningOnCompositor && !m_scrollableArea->layerForScrolling()) {
+ m_runState = RunState::RunningOnMainThread;
+ m_compositorAnimationId = 0;
+ m_compositorAnimationGroupId = 0;
+ m_animationCurve->setInitialValue(FloatPoint(m_scrollableArea->scrollPosition()));
+ m_scrollableArea->registerForAnimation();
+ if (!m_scrollableArea->scheduleAnimation()) {
+ resetAnimationState();
+ m_scrollableArea->notifyScrollPositionChanged(IntPoint(m_targetOffset.x(), m_targetOffset.y()));
+ }
+ }
+}
+
void ProgrammaticScrollAnimator::notifyCompositorAnimationFinished(int groupId)
{
if (m_compositorAnimationGroupId != groupId)
« no previous file with comments | « Source/platform/scroll/ProgrammaticScrollAnimator.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698