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

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

Issue 1738243002: Removed main-thread one dimensional scrolling paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@removeStepFromUserScroll
Patch Set: Rebase Created 4 years, 10 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/ScrollAnimatorBase.h
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h
index c50eac24ec0a3b4f63f89b4a662ae7b668e2d50f..68d78057f6ca6dd50cd67e231084252ebd700b08 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h
@@ -54,12 +54,13 @@ public:
virtual void dispose() { }
- // Computes a scroll destination for the given parameters. The returned
- // ScrollResultOneDimensional will have didScroll set to false if already at
- // the destination. Otherwise, starts scrolling towards the destination and
- // didScroll is true. Scrolling may be immediate or animated. The base
- // class implementation always scrolls immediately, never animates.
- virtual ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGranularity, float delta);
+ // A possibly animated scroll. The base class implementation always scrolls
+ // immediately, never animates. If the scroll is animated and currently the
+ // animator has an in-progress animation, the ScrollResult will always return
+ // no unusedDelta and didScroll=true, i.e. fully consuming the scroll request.
+ // This makes animations latch to a single scroller. Note, the semantics are
+ // currently somewhat different on Mac - see ScrollAnimatorMac.mm.
+ virtual ScrollResult userScroll(ScrollGranularity, const FloatSize& delta);
virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
@@ -73,7 +74,7 @@ public:
// Returns how much of pixelDelta will be used by the underlying scrollable
// area.
- virtual float computeDeltaToConsume(ScrollbarOrientation, float pixelDelta) const;
+ virtual FloatSize computeDeltaToConsume(const FloatSize& delta) const;
// ScrollAnimatorCompositorCoordinator implementation.
@@ -118,11 +119,9 @@ protected:
virtual void notifyPositionChanged();
- float clampScrollPosition(ScrollbarOrientation, float) const;
-
RawPtrWillBeMember<ScrollableArea> m_scrollableArea;
- float m_currentPosX; // We avoid using a FloatPoint in order to reduce
- float m_currentPosY; // subclass code complexity.
+
+ FloatPoint m_currentPos;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698