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

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: fix compile error on mac 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..b1be4a28d8d8fe5f3d537fc20cc3b888d375bd16 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.h
@@ -34,13 +34,16 @@
#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 {
+class PLATFORM_EXPORT ScrollAnimator final : public ScrollAnimatorBase {
skobes 2015/12/18 19:05:58 extra space before {
ymalik 2015/12/18 19:35:47 Done.
public:
explicit ScrollAnimator(ScrollableArea*, WTF::TimeFunction = WTF::monotonicallyIncreasingTime);
~ScrollAnimator() override;
@@ -50,20 +53,27 @@ 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;
skobes 2015/12/18 19:05:57 Why is this needed here if it's also stored in m_a
ymalik 2015/12/18 19:35:47 m_animationCurve is actually set when updateCompos
+ FloatPoint m_initialOffset;
skobes 2015/12/18 19:05:58 This seems unused?
ymalik 2015/12/18 19:35:47 Oops. Forgot to remove after testing. Thanks.
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698