Index: third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp |
index dc3a7ca882bf30a320d76c34d6b720683e2947e6..5af07c8e5f9e96bd4ec87fe3df0d4b8472bdf4f8 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp |
@@ -52,6 +52,7 @@ bool ScrollAnimatorCompositorCoordinator::hasAnimationThatRequiresService() cons |
return false; |
case RunState::WaitingToSendToCompositor: |
case RunState::RunningOnMainThread: |
+ case RunState::RunningOnCompositorButNeedsUpdate: |
case RunState::WaitingToCancelOnCompositor: |
return true; |
} |
@@ -84,6 +85,17 @@ void ScrollAnimatorCompositorCoordinator::removeAnimation() |
} |
} |
+void ScrollAnimatorCompositorCoordinator::abortAnimation() |
+{ |
+ if (m_compositorPlayer) { |
+ if (m_compositorPlayer->isLayerAttached()) |
+ m_compositorPlayer->abortAnimation(m_compositorAnimationId); |
+ } else { |
+ if (GraphicsLayer* layer = scrollableArea()->layerForScrolling()) |
+ layer->abortAnimation(m_compositorAnimationId); |
+ } |
+} |
+ |
void ScrollAnimatorCompositorCoordinator::cancelAnimation() |
{ |
switch (m_runState) { |
@@ -101,6 +113,7 @@ void ScrollAnimatorCompositorCoordinator::cancelAnimation() |
case RunState::RunningOnMainThread: |
resetAnimationState(); |
break; |
+ case RunState::RunningOnCompositorButNeedsUpdate: |
case RunState::RunningOnCompositor: |
m_runState = RunState::WaitingToCancelOnCompositor; |
@@ -126,6 +139,7 @@ void ScrollAnimatorCompositorCoordinator::compositorAnimationFinished( |
case RunState::WaitingToSendToCompositor: |
break; |
case RunState::RunningOnCompositor: |
+ case RunState::RunningOnCompositorButNeedsUpdate: |
case RunState::WaitingToCancelOnCompositor: |
resetAnimationState(); |
} |