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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 626113004: CC: Have GPU-raster tiles exactly match the viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CC_cleanup_tile_grid_size
Patch Set: Fix tests for min-size. 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 | « cc/layers/picture_layer_impl.cc ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_unittest.cc
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index b25a9d504aa365c650ad3814006ec56405ec754b..d6b5612c6d1f439dc441a840f42b69575d6ccb44 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -4387,8 +4387,7 @@ TEST_F(TileSizeTest, TileSizes) {
scoped_ptr<FakePictureLayerImpl> layer =
FakePictureLayerImpl::Create(pending_tree, id_);
- gfx::Size viewport_size = gfx::Size(1000, 1000);
- host_impl_.SetViewportSize(viewport_size);
+ host_impl_.SetViewportSize(gfx::Size(1000, 1000));
gfx::Size result;
host_impl_.SetUseGpuRasterization(false);
@@ -4401,29 +4400,27 @@ TEST_F(TileSizeTest, TileSizes) {
result = layer->CalculateTileSize(gfx::Size(42, 42));
EXPECT_EQ(result.width(), 64);
EXPECT_EQ(result.height(), 64);
- result = layer->CalculateTileSize(gfx::Size(184, 184));
+ result = layer->CalculateTileSize(gfx::Size(191, 191));
EXPECT_EQ(result.width(), 192);
EXPECT_EQ(result.height(), 192);
result = layer->CalculateTileSize(gfx::Size(199, 199));
EXPECT_EQ(result.width(), 200);
EXPECT_EQ(result.height(), 200);
- host_impl_.SetUseGpuRasterization(true);
-
// Gpu-rasterization uses 25% viewport-height tiles.
+ // The +2's below are for border texels.
+ host_impl_.SetUseGpuRasterization(true);
+ host_impl_.SetViewportSize(gfx::Size(2000, 2000));
result = layer->CalculateTileSize(gfx::Size(10000, 10000));
- EXPECT_EQ(result.width(), 1000);
- EXPECT_EQ(result.height(), 250);
+ EXPECT_EQ(result.width(), 2000);
+ EXPECT_EQ(result.height(), 500 + 2);
// Clamp and round-up, when smaller than viewport.
- result = layer->CalculateTileSize(gfx::Size(831, 10000));
- EXPECT_EQ(result.width(), 832);
- EXPECT_EQ(result.height(), 250);
-
// Tile-height doubles to 50% when width shrinks to <= 50%.
+ host_impl_.SetViewportSize(gfx::Size(1000, 1000));
result = layer->CalculateTileSize(gfx::Size(447, 10000));
EXPECT_EQ(result.width(), 448);
- EXPECT_EQ(result.height(), 500);
+ EXPECT_EQ(result.height(), 500 + 2);
// Largest layer is 50% of viewport width (rounded up), and
// 50% of viewport in height.
@@ -4432,7 +4429,7 @@ TEST_F(TileSizeTest, TileSizes) {
EXPECT_EQ(result.height(), 448);
result = layer->CalculateTileSize(gfx::Size(500, 499));
EXPECT_EQ(result.width(), 512);
- EXPECT_EQ(result.height(), 500);
+ EXPECT_EQ(result.height(), 500 + 2);
}
} // namespace
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698