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

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

Issue 1782563002: Takeover MT initiated animations from the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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
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 798d468459513d8b21a29ba751733479481c3bfe..27dfece11f6ad9c1e092ba88961e180ddb50ae6b 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
@@ -65,6 +65,7 @@ bool ScrollAnimatorCompositorCoordinator::hasAnimationThatRequiresService() cons
case RunState::WaitingToSendToCompositor:
case RunState::RunningOnMainThread:
case RunState::RunningOnCompositorButNeedsUpdate:
+ case RunState::RunningOnCompositorButNeedsTakeover:
case RunState::WaitingToCancelOnCompositor:
return true;
}
@@ -115,6 +116,7 @@ void ScrollAnimatorCompositorCoordinator::cancelAnimation()
case RunState::WaitingToCancelOnCompositor:
case RunState::PostAnimationCleanup:
break;
+ case RunState::RunningOnCompositorButNeedsTakeover:
case RunState::WaitingToSendToCompositor:
if (m_compositorAnimationId) {
// We still have a previous animation running on the compositor.
@@ -135,6 +137,30 @@ void ScrollAnimatorCompositorCoordinator::cancelAnimation()
}
}
+void ScrollAnimatorCompositorCoordinator::takeoverCompositorAnimation()
+{
+ switch (m_runState) {
+ case RunState::Idle:
+ case RunState::WaitingToCancelOnCompositor:
+ case RunState::PostAnimationCleanup:
+ case RunState::RunningOnCompositorButNeedsTakeover:
+ case RunState::WaitingToSendToCompositor:
+ case RunState::RunningOnMainThread:
+ break;
+ case RunState::RunningOnCompositorButNeedsUpdate:
+ case RunState::RunningOnCompositor:
+ // We call abortAnimation that makes changes to the animation running on
+ // the compositor. Thus, this function should only be called when in
+ // CompositingClean state.
+ abortAnimation();
+
+ m_runState = RunState::RunningOnCompositorButNeedsTakeover;
+
+ // Get serviced the next time compositor updates are allowed.
+ scrollableArea()->registerForAnimation();
+ }
+}
+
void ScrollAnimatorCompositorCoordinator::compositorAnimationFinished(
int groupId)
{
@@ -154,6 +180,7 @@ void ScrollAnimatorCompositorCoordinator::compositorAnimationFinished(
break;
case RunState::RunningOnCompositor:
case RunState::RunningOnCompositorButNeedsUpdate:
+ case RunState::RunningOnCompositorButNeedsTakeover:
case RunState::WaitingToCancelOnCompositor:
m_runState = RunState::PostAnimationCleanup;
// Get serviced the next time compositor updates are allowed.

Powered by Google App Engine
This is Rietveld 408576698