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

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

Issue 1950243005: Communicate MT changes to impl-only scroll offset animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: attempt to fix rebase issue Created 4 years, 7 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 9b69df747f69c2eef0b5c786e4b457f06511894c..2fa5de6a94a271b38de631c6fcb34592d3bd30e0 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.h
@@ -7,6 +7,7 @@
#include "base/gtest_prod_util.h"
#include "cc/animation/animation_curve.h"
+#include "cc/animation/scroll_offset_animations.h"
#include "platform/PlatformExport.h"
#include "platform/animation/CompositorAnimationDelegate.h"
#include "platform/animation/CompositorAnimationPlayerClient.h"
@@ -33,6 +34,8 @@ public:
void dispose();
String runStateAsText() const;
+ void updateImplOnlyScrollOffsetAnimation(const FloatSize& adjustment);
+
virtual bool hasRunningAnimation() const { return false; }
virtual void resetAnimationState();
@@ -41,10 +44,10 @@ public:
// and continues it on the main thread. This should only be called when in
// DocumentLifecycle::LifecycleState::CompositingClean state.
virtual void takeoverCompositorAnimation();
+ virtual void updateCompositorAnimations();
virtual ScrollableArea* getScrollableArea() const = 0;
virtual void tickAnimation(double monotonicTime) = 0;
- virtual void updateCompositorAnimations() = 0;
virtual void notifyCompositorAnimationFinished(int groupId) = 0;
virtual void notifyCompositorAnimationAborted(int groupId) = 0;
virtual void layerForCompositedScrollingDidChange(CompositorAnimationTimeline*) = 0;
@@ -54,6 +57,8 @@ public:
protected:
explicit ScrollAnimatorCompositorCoordinator();
+ FloatSize implOnlyAnimationAdjustmentForTesting() { return m_implOnlyAnimationAdjustment; }
+
bool addAnimation(PassOwnPtr<CompositorAnimation>);
void removeAnimation();
virtual void abortAnimation();
@@ -78,10 +83,13 @@ protected:
CompositorAnimationPlayer* compositorPlayer() const override;
friend class Internals;
+ // TODO(ymalik): Tests are added as friends to access m_RunState. Expose
+ // it using ForTesting accessor or find a better way to test this.
FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, MainThreadStates);
FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, AnimatedScrollTakeover);
FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, CancellingAnimationResetsState);
FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, CancellingCompositorAnimation);
+ FRIEND_TEST_ALL_PREFIXES(ScrollAnimatorTest, ImplOnlyAnimationUpdatesCleared);
enum class RunState {
// No animation.
@@ -127,6 +135,10 @@ protected:
RunState m_runState;
int m_compositorAnimationId;
int m_compositorAnimationGroupId;
+
+ // An adjustment to the scroll offset on the main thread that may affect
+ // impl-only scroll offset animations.
+ FloatSize m_implOnlyAnimationAdjustment;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698