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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: rebase 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/graphics/GraphicsLayer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 56503d84012376488405d0cb8e4819c1408d3c84..562380a63cb6511ae7f5e79a4eaaa841a5264e49 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -1109,14 +1109,10 @@ void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea,
void GraphicsLayer::didScroll() {
if (m_scrollableArea) {
- DoublePoint newPosition =
- -m_scrollableArea->scrollOrigin() +
- toDoubleSize(m_layer->layer()->scrollPositionDouble());
-
- // FrameView::setScrollPosition doesn't work for compositor commits (interacts poorly with programmatic scroll animations)
- // so we need to use the ScrollableArea version. The FrameView method should go away soon anyway.
- m_scrollableArea->ScrollableArea::setScrollPosition(newPosition,
- CompositorScroll);
+ ScrollOffset newOffset = toScrollOffset(-m_scrollableArea->scrollOrigin()) +
+ m_layer->layer()->scrollOffset();
+
+ m_scrollableArea->setScrollOffset(newOffset, CompositorScroll);
}
}

Powered by Google App Engine
This is Rietveld 408576698