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

Unified Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 2629793003: Revert "Round the scroll offset synced back to main instead of flooring." (Closed)
Patch Set: Created 3 years, 11 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 | « 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 a3bd9360a1085ff829f38c7abeaa47ef31364d35..c54351603de8dadd613996ce7d4da6be69c5e21c 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -463,22 +463,20 @@ class LayerTreeHostScrollTestFractionalScroll : public LayerTreeHostScrollTest {
break;
case 1:
EXPECT_VECTOR_EQ(
- gfx::ToRoundedVector2d(scroll_amount_),
+ gfx::ToFlooredVector2d(scroll_amount_),
ScrollTreeForLayer(scroll_layer)
->GetScrollOffsetBaseForTesting(scroll_layer->id()));
- EXPECT_VECTOR_EQ(
- scroll_amount_ - gfx::ToRoundedVector2d(scroll_amount_),
- ScrollDelta(scroll_layer));
+ EXPECT_VECTOR_EQ(gfx::Vector2dF(fmod(scroll_amount_.x(), 1.0f), 0.0f),
+ ScrollDelta(scroll_layer));
PostSetNeedsCommitToMainThread();
break;
case 2:
EXPECT_VECTOR_EQ(
- gfx::ToRoundedVector2d(scroll_amount_ + scroll_amount_),
+ gfx::ToFlooredVector2d(scroll_amount_ + scroll_amount_),
ScrollTreeForLayer(scroll_layer)
->GetScrollOffsetBaseForTesting(scroll_layer->id()));
EXPECT_VECTOR_EQ(
- scroll_amount_ + scroll_amount_ -
- gfx::ToRoundedVector2d(scroll_amount_ + scroll_amount_),
+ gfx::Vector2dF(fmod(2.0f * scroll_amount_.x(), 1.0f), 0.0f),
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