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

Unified Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 2529013003: Round the scroll offset synced back to main instead of flooring. (Closed)
Patch Set: Created 4 years, 1 month 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 | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_scroll.cc
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 473d5285e4342d38cb249793f7ac90161be552bb..dcb3cbd11416307a4313f26a3e598995a65962c6 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -462,20 +462,22 @@ class LayerTreeHostScrollTestFractionalScroll : public LayerTreeHostScrollTest {
break;
case 1:
EXPECT_VECTOR_EQ(
- gfx::ToFlooredVector2d(scroll_amount_),
+ gfx::ToRoundedVector2d(scroll_amount_),
ScrollTreeForLayer(scroll_layer)
->GetScrollOffsetBaseForTesting(scroll_layer->id()));
- EXPECT_VECTOR_EQ(gfx::Vector2dF(fmod(scroll_amount_.x(), 1.0f), 0.0f),
- ScrollDelta(scroll_layer));
+ EXPECT_VECTOR_EQ(
+ scroll_amount_ - gfx::ToRoundedVector2d(scroll_amount_),
+ ScrollDelta(scroll_layer));
PostSetNeedsCommitToMainThread();
break;
case 2:
EXPECT_VECTOR_EQ(
- gfx::ToFlooredVector2d(scroll_amount_ + scroll_amount_),
+ gfx::ToRoundedVector2d(scroll_amount_ + scroll_amount_),
ScrollTreeForLayer(scroll_layer)
->GetScrollOffsetBaseForTesting(scroll_layer->id()));
EXPECT_VECTOR_EQ(
- gfx::Vector2dF(fmod(2.0f * scroll_amount_.x(), 1.0f), 0.0f),
+ scroll_amount_ + scroll_amount_ -
+ gfx::ToRoundedVector2d(scroll_amount_ + scroll_amount_),
ScrollDelta(scroll_layer));
EndTest();
break;
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698