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

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

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 years, 2 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 6e78dfaed5df458ddd2d5b2c016f0ba1beeee703..24a07d17171bbcb913545d8d68937b54f9586aae 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.h
@@ -33,8 +33,6 @@
#include "platform/PlatformExport.h"
#include "platform/PlatformWheelEvent.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/geometry/FloatSize.h"
#include "platform/heap/Handle.h"
#include "platform/scroll/ScrollAnimatorCompositorCoordinator.h"
#include "platform/scroll/ScrollTypes.h"
@@ -61,21 +59,21 @@ class PLATFORM_EXPORT ScrollAnimatorBase
// 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 ScrollResult userScroll(ScrollGranularity, const ScrollOffset& delta);
- virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
+ virtual void scrollToOffsetWithoutAnimation(const ScrollOffset&);
#if OS(MACOSX)
virtual void handleWheelEventPhase(PlatformWheelEventPhase) {}
#endif
- void setCurrentPosition(const FloatPoint&);
- FloatPoint currentPosition() const;
- virtual FloatPoint desiredTargetPosition() const { return currentPosition(); }
+ void setCurrentOffset(const ScrollOffset&);
+ ScrollOffset currentOffset() const;
+ virtual ScrollOffset desiredTargetOffset() const { return currentOffset(); }
// Returns how much of pixelDelta will be used by the underlying scrollable
// area.
- virtual FloatSize computeDeltaToConsume(const FloatSize& delta) const;
+ virtual ScrollOffset computeDeltaToConsume(const ScrollOffset& delta) const;
// ScrollAnimatorCompositorCoordinator implementation.
ScrollableArea* getScrollableArea() const override {
@@ -112,7 +110,7 @@ class PLATFORM_EXPORT ScrollAnimatorBase
return true;
}
- virtual void notifyContentAreaScrolled(const FloatSize&) {}
+ virtual void notifyContentAreaScrolled(const ScrollOffset&) {}
virtual bool setScrollbarsVisibleForTesting(bool) { return false; }
@@ -121,11 +119,11 @@ class PLATFORM_EXPORT ScrollAnimatorBase
protected:
explicit ScrollAnimatorBase(ScrollableArea*);
- virtual void notifyPositionChanged();
+ virtual void notifyOffsetChanged();
Member<ScrollableArea> m_scrollableArea;
- FloatPoint m_currentPos;
+ ScrollOffset m_currentOffset;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698