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

Unified Diff: Source/platform/graphics/GraphicsLayerTest.cpp

Issue 629583002: Make compositor and blink talk in fractional scroll offset (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.cpp ('k') | Source/web/tests/ScrollingCoordinatorChromiumTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsLayerTest.cpp
diff --git a/Source/platform/graphics/GraphicsLayerTest.cpp b/Source/platform/graphics/GraphicsLayerTest.cpp
index e1b6950fa3b288d90e0314f5f1bcfc6a949ec608..9af7292ea2e63f66e2115148ffccf96493823078 100644
--- a/Source/platform/graphics/GraphicsLayerTest.cpp
+++ b/Source/platform/graphics/GraphicsLayerTest.cpp
@@ -146,10 +146,12 @@ public:
}
virtual void setScrollOffset(const IntPoint& scrollOffset) override { m_scrollPosition = scrollOffset; }
- virtual IntPoint scrollPosition() const override { return m_scrollPosition; }
+ virtual void setScrollOffset(const DoublePoint& scrollOffset) override { m_scrollPosition = scrollOffset; }
+ virtual DoublePoint scrollPositionDouble() const override { return m_scrollPosition; }
+ virtual IntPoint scrollPosition() const override { return flooredIntPoint(m_scrollPosition); }
private:
- IntPoint m_scrollPosition;
+ DoublePoint m_scrollPosition;
};
TEST_F(GraphicsLayerTest, applyScrollToScrollableArea)
@@ -157,11 +159,12 @@ TEST_F(GraphicsLayerTest, applyScrollToScrollableArea)
FakeScrollableArea scrollableArea;
m_graphicsLayer->setScrollableArea(&scrollableArea, false);
- WebPoint scrollPosition(7, 9);
- m_platformLayer->setScrollPosition(scrollPosition);
+ WebDoublePoint scrollPosition(7.2, 9.6);
+ m_platformLayer->setScrollPositionDouble(scrollPosition);
m_graphicsLayer->didScroll();
- EXPECT_EQ(scrollPosition, WebPoint(scrollableArea.scrollPosition()));
+ EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea.scrollPositionDouble().x());
+ EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea.scrollPositionDouble().y());
}
} // namespace
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.cpp ('k') | Source/web/tests/ScrollingCoordinatorChromiumTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698