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

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

Issue 1534813004: Run smooth scroll animations on the compositor when possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years 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/ScrollAnimator.h
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.h b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.h
index 01746e683e176296ad1cc6b591801b1803e85b90..5d8f20a3f84d00c41494120eae3ec0b660651b00 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.h
@@ -34,11 +34,14 @@
#include "platform/Timer.h"
#include "platform/geometry/FloatPoint.h"
#include "platform/scroll/ScrollAnimatorBase.h"
+#include "public/platform/WebCompositorAnimationDelegate.h"
+#include "public/platform/WebCompositorAnimationPlayerClient.h"
#include "public/platform/WebScrollOffsetAnimationCurve.h"
namespace blink {
class ScrollAnimatorTest;
+class WebCompositorAnimationTimeline;
class PLATFORM_EXPORT ScrollAnimator final : public ScrollAnimatorBase {
public:
@@ -50,20 +53,26 @@ public:
ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGranularity, float step, float delta) override;
void scrollToOffsetWithoutAnimation(const FloatPoint&) override;
- void cancelAnimations() override;
- void serviceScrollAnimations() override;
- bool hasRunningAnimation() const override;
+ // ScrollAnimatorCompositorCoordinator implementation.
+ void tickAnimation(double monotonicTime) override;
+ void cancelAnimation() override;
+ void resetAnimationState() override;
+ void updateCompositorAnimations() override;
+ void notifyCompositorAnimationFinished(int groupId) override;
+ void layerForCompositedScrollingDidChange(WebCompositorAnimationTimeline*) override;
DECLARE_VIRTUAL_TRACE();
protected:
- void animationTimerFired();
-
OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve;
+ double m_lastTickTime;
double m_startTime;
WTF::TimeFunction m_timeFunction;
+
private:
FloatPoint desiredTargetPosition() const;
+
+ FloatPoint m_targetOffset;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698