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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 1379783002: Allow one-copy task tile worker pool to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove needs_conversion, fix tile size unit test and move modulo 4 DCHECK (for tests) Created 5 years 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
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 1839690cfc53247fb021559f844bc2ea6b325e02..a43707450827a8abbed9c20d0ceef39fa2af2e25 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -4984,8 +4984,10 @@ TEST_F(TileSizeTest, TileSizes) {
layer->set_gpu_raster_max_texture_size(host_impl_.device_viewport_size());
result = layer->CalculateTileSize(gfx::Size(10000, 10000));
- EXPECT_EQ(result.width(), 2000 + 2 * PictureLayerTiling::kBorderTexels);
- EXPECT_EQ(result.height(), 500 + 2);
+ EXPECT_EQ(result.width(),
+ MathUtil::UncheckedRoundUp(
+ 2000 + 2 * PictureLayerTiling::kBorderTexels, 4));
+ EXPECT_EQ(result.height(), 504); // 500 + 2, 4-byte aligned.
// Clamp and round-up, when smaller than viewport.
// Tile-height doubles to 50% when width shrinks to <= 50%.
@@ -4993,7 +4995,7 @@ TEST_F(TileSizeTest, TileSizes) {
layer->set_gpu_raster_max_texture_size(host_impl_.device_viewport_size());
result = layer->CalculateTileSize(gfx::Size(447, 10000));
EXPECT_EQ(result.width(), 448);
- EXPECT_EQ(result.height(), 500 + 2);
+ EXPECT_EQ(result.height(), 504); // 500 + 2, 4-byte aliged.
// Largest layer is 50% of viewport width (rounded up), and
// 50% of viewport in height.
@@ -5002,7 +5004,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 + 2);
+ EXPECT_EQ(result.height(), 504); // 500 + 2, 4-byte aligned.
}
TEST_F(NoLowResPictureLayerImplTest, LowResWasHighResCollision) {

Powered by Google App Engine
This is Rietveld 408576698