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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 496473002: Fix spurious 1px scrolling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« cc/layers/layer_impl.cc ('K') | « cc/layers/layer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 1322f835e08d0e75f29d17c3aba64ed729847e98..5a83a0131db9f640080197cf65f18bcea06e3266 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -3041,6 +3041,21 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
wheel_scroll_delta);
}
+TEST_F(LayerTreeHostImplTest, ScrollViewportRounding) {
+ int width = 332;
+ int height = 20;
+ int scale = 3;
+ SetupScrollAndContentsLayers(gfx::Size(width, height));
+ host_impl_->SetViewportSize(gfx::Size(width * scale - 1, height * scale));
+ host_impl_->SetDeviceScaleFactor(scale);
+ host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
+
+ LayerImpl* inner_viewport_scroll_layer =
+ host_impl_->active_tree()->InnerViewportScrollLayer();
+ EXPECT_EQ(gfx::Vector2d(0, 0),
+ inner_viewport_scroll_layer->MaxScrollOffset());
+}
+
class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
public:
TestScrollOffsetDelegate()
« cc/layers/layer_impl.cc ('K') | « cc/layers/layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698