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

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

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.h
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
index 752b06804f89f6ddddfb83ca0ba613a1bbc10087..4ebf061b300285eada04e8e1c2b1109ed38e655e 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
@@ -36,6 +36,10 @@ public:
virtual void resetAnimationState();
virtual void cancelAnimation();
+ // Aborts the currently running scroll offset animation on the compositor
+ // and continues it on the main thread. This should only be called when in
+ // DocumentLifecycle::LifecycleState::CompositingClean state.
+ virtual void takeoverCompositorAnimation();
virtual ScrollableArea* scrollableArea() const = 0;
virtual void tickAnimation(double monotonicTime) = 0;
@@ -51,7 +55,7 @@ protected:
bool addAnimation(PassOwnPtr<CompositorAnimation>);
void removeAnimation();
- void abortAnimation();
+ virtual void abortAnimation();
void compositorAnimationFinished(int groupId);
// Returns true if the compositor player was attached to a new layer.
@@ -71,6 +75,7 @@ protected:
friend class Internals;
FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, MainThreadStates);
+ FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, AnimatedScrollTakeover);
enum class RunState {
// No animation.
@@ -97,7 +102,12 @@ protected:
// Finished an animation that was running on the main thread or the
// compositor thread. When in this state, post animation cleanup can
// be performed.
- PostAnimationCleanup
+ PostAnimationCleanup,
+
+ // Running an animation on the compositor but need to continue it
+ // on the main thread. This could happen if a main thread scrolling
+ // reason is added while animating the scroll offset.
+ RunningOnCompositorButNeedsTakeover,
};
OwnPtr<CompositorAnimationPlayer> m_compositorPlayer;

Powered by Google App Engine
This is Rietveld 408576698