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

Unified Diff: Source/platform/scroll/ScrollableArea.h

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/platform/scroll/ScrollView.cpp ('k') | Source/platform/scroll/ScrollableArea.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollableArea.h
diff --git a/Source/platform/scroll/ScrollableArea.h b/Source/platform/scroll/ScrollableArea.h
index 15b27b7cc4fd541aac0935766f7f9d4bf5c1dff8..d3b774d60409276b6053eba7d9c104e2b92c6b45 100644
--- a/Source/platform/scroll/ScrollableArea.h
+++ b/Source/platform/scroll/ScrollableArea.h
@@ -39,6 +39,7 @@ class GraphicsContext;
class GraphicsLayer;
class PlatformGestureEvent;
class PlatformWheelEvent;
+class ProgrammaticScrollAnimator;
class ScrollAnimator;
enum ScrollBehavior {
@@ -63,6 +64,8 @@ public:
void scrollToOffsetWithoutAnimation(const FloatPoint&);
void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
+ void programmaticallyScrollSmoothlyToOffset(const FloatPoint&);
+
// Should be called when the scroll position changes externally, for example if the scroll layer position
// is updated on the scrolling thread and we need to notify the main thread.
void notifyScrollPositionChanged(const IntPoint&);
@@ -111,6 +114,12 @@ public:
// This getter will return null if the ScrollAnimator hasn't been created yet.
ScrollAnimator* existingScrollAnimator() const { return m_scrollAnimator.get(); }
+ ProgrammaticScrollAnimator* programmaticScrollAnimator() const;
+ ProgrammaticScrollAnimator* existingProgrammaticScrollAnimator() const
+ {
+ return m_programmaticScrollAnimator.get();
+ }
+
const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
bool scrollOriginChanged() const { return m_scrollOriginChanged; }
@@ -178,8 +187,10 @@ public:
// Let subclasses provide a way of asking for and servicing scroll
// animations.
+ virtual void registerForAnimation() { }
+ virtual void deregisterForAnimation() { }
virtual bool scheduleAnimation() { return false; }
- void serviceScrollAnimations();
+ virtual void serviceScrollAnimations(double monotonicTime);
virtual bool usesCompositedScrolling() const { return false; }
@@ -189,6 +200,14 @@ public:
virtual bool userInputScrollable(ScrollbarOrientation) const = 0;
virtual bool shouldPlaceVerticalScrollbarOnLeft() const = 0;
+ // Notifications for compositor-driven animations.
+ void notifyAnimationStarted(double monotonicTime);
+ void notifyAnimationFinished(double monotonicTime);
+
+ void layerForScrollingDidChange();
+ void requiresMainThreadScrollingDidChange();
+ bool canUseCompositedScrollAnimations() const;
+
// Convenience functions
int scrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); }
int minimumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? minimumScrollPosition().x() : minimumScrollPosition().y(); }
@@ -224,6 +243,8 @@ public:
bool hasLayerForVerticalScrollbar() const;
bool hasLayerForScrollCorner() const;
+ void cancelProgrammaticScrollAnimation();
+
protected:
ScrollableArea();
virtual ~ScrollableArea();
@@ -258,6 +279,7 @@ private:
virtual float pixelStep(ScrollbarOrientation) const;
mutable OwnPtr<ScrollAnimator> m_scrollAnimator;
+ mutable OwnPtr<ProgrammaticScrollAnimator> m_programmaticScrollAnimator;
unsigned m_constrainsScrollingToContentEdge : 1;
unsigned m_inLiveResize : 1;
« no previous file with comments | « Source/platform/scroll/ScrollView.cpp ('k') | Source/platform/scroll/ScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698