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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp

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/ScrollAnimatorCompositorCoordinator.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
index cdcd67ae22fcd6bc9ab4c1ce8fbe4604f50359b2..98bca4b9307bfad1e983291c2d86f6a8b9a5472a 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp
@@ -237,15 +237,14 @@ ScrollAnimatorCompositorCoordinator::compositorPlayer() const {
}
FloatPoint ScrollAnimatorCompositorCoordinator::compositorOffsetFromBlinkOffset(
- FloatPoint offset) {
- offset.moveBy(getScrollableArea()->scrollOrigin());
- return offset;
+ ScrollOffset offset) {
+ return getScrollableArea()->scrollOrigin() + offset;
}
-FloatPoint ScrollAnimatorCompositorCoordinator::blinkOffsetFromCompositorOffset(
+ScrollOffset
+ScrollAnimatorCompositorCoordinator::blinkOffsetFromCompositorOffset(
FloatPoint offset) {
- offset.moveBy(-getScrollableArea()->scrollOrigin());
- return offset;
+ return offset - getScrollableArea()->scrollOrigin();
}
bool ScrollAnimatorCompositorCoordinator::hasImplOnlyAnimationUpdate() const {
@@ -281,17 +280,17 @@ void ScrollAnimatorCompositorCoordinator::updateCompositorAnimations() {
updateImplOnlyCompositorAnimations();
}
-void ScrollAnimatorCompositorCoordinator::scrollPositionChanged(
- const DoublePoint& offset,
+void ScrollAnimatorCompositorCoordinator::scrollOffsetChanged(
+ const ScrollOffset& offset,
ScrollType scrollType) {
- getScrollableArea()->scrollPositionChanged(offset, scrollType);
+ getScrollableArea()->scrollOffsetChanged(offset, scrollType);
}
-void ScrollAnimatorCompositorCoordinator::adjustAnimationAndSetScrollPosition(
- const DoublePoint& position,
+void ScrollAnimatorCompositorCoordinator::adjustAnimationAndSetScrollOffset(
+ const ScrollOffset& offset,
ScrollType scrollType) {
// Subclasses should override this and adjust the animation as necessary.
- scrollPositionChanged(position, scrollType);
+ scrollOffsetChanged(offset, scrollType);
}
void ScrollAnimatorCompositorCoordinator::adjustImplOnlyScrollOffsetAnimation(

Powered by Google App Engine
This is Rietveld 408576698