Chromium Code Reviews| 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 ba6c6bbbe2f618ff952b3993f1da87c74ffbf77c..653f8961e7c1e00c968aa2ca219af17443e86c8c 100644 |
| --- a/cc/layers/picture_layer_impl_unittest.cc |
| +++ b/cc/layers/picture_layer_impl_unittest.cc |
| @@ -1166,6 +1166,58 @@ TEST_F(PictureLayerImplTest, DontAddLowResForSmallLayers) { |
| EXPECT_BOTH_EQ(num_tilings(), 1u); |
| } |
| +TEST_F(PictureLayerImplTest, HugeMasksDontGetTiles) { |
| + gfx::Size tile_size(host_impl_.settings().default_tile_size); |
| + SetupDefaultTrees(tile_size); |
| + |
| + float contents_scale = 1.f; |
| + float device_scale = 1.f; |
| + float page_scale = 1.f; |
| + float maximum_animation_scale = 1.f; |
| + bool animating_transform = false; |
| + |
| + pending_layer_->SetIsMask(true); |
| + active_layer_->SetIsMask(true); |
| + SetContentsScaleOnBothLayers(contents_scale, |
| + device_scale, |
| + page_scale, |
| + maximum_animation_scale, |
| + animating_transform); |
| + EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), contents_scale); |
| + EXPECT_BOTH_EQ(num_tilings(), 1u); |
| + |
| + pending_layer_->HighResTiling()->CreateAllTilesForTesting(); |
| + active_layer_->HighResTiling()->CreateAllTilesForTesting(); |
| + |
| + // Mask layers have a tiling with a single tile in it. |
| + EXPECT_BOTH_EQ(HighResTiling()->AllTilesForTesting().size(), 1u); |
| + |
| + ResetTilingsAndRasterScales(); |
| + |
| + int max_texture_size = host_impl_.GetRendererCapabilities().max_texture_size; |
| + EXPECT_LE(pending_layer_->bounds().width(), max_texture_size); |
| + EXPECT_LE(pending_layer_->bounds().height(), max_texture_size); |
| + EXPECT_LE(active_layer_->bounds().width(), max_texture_size); |
| + EXPECT_LE(active_layer_->bounds().height(), max_texture_size); |
| + |
| + pending_layer_->SetBounds(gfx::Size(max_texture_size + 1, 10)); |
| + active_layer_->SetBounds(gfx::Size(10, max_texture_size + 1)); |
| + |
| + SetContentsScaleOnBothLayers(contents_scale, |
| + device_scale, |
| + page_scale, |
| + maximum_animation_scale, |
| + animating_transform); |
| + EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), contents_scale); |
| + EXPECT_BOTH_EQ(num_tilings(), 1u); |
| + |
| + pending_layer_->HighResTiling()->CreateAllTilesForTesting(); |
| + active_layer_->HighResTiling()->CreateAllTilesForTesting(); |
| + |
| + // Mask layers have a tiling, but there should be no tiles in it. |
| + EXPECT_BOTH_EQ(HighResTiling()->AllTilesForTesting().size(), 1u); |
|
enne (OOO)
2014/09/05 17:41:46
"there should be no tiles" but 1u?
Also, can you
danakj
2014/09/05 22:09:52
Oh snap, thanks. My test is bad and I feel bad.
|
| +} |
| + |
| TEST_F(PictureLayerImplTest, ReleaseResources) { |
| gfx::Size tile_size(400, 400); |
| gfx::Size layer_bounds(1300, 1900); |