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 c606be43e5f3f6ea46ea622deb9c44edb35faa3f..47fe0c1ff77a388bdddbcf2f8b78c82a78f53264 100644 |
| --- a/cc/layers/picture_layer_impl_unittest.cc |
| +++ b/cc/layers/picture_layer_impl_unittest.cc |
| @@ -1500,7 +1500,7 @@ TEST_F(PictureLayerImplTest, SyncTilingAfterReleaseResource) { |
| EXPECT_TRUE(active_layer_->tilings()->TilingAtScale(tile_scale)); |
| } |
| -TEST_F(PictureLayerImplTest, TilingWithoutGpuRasterization) { |
| +TEST_F(PictureLayerImplTest, NoLowResTilingWithGpuRasterization) { |
| gfx::Size default_tile_size(host_impl_.settings().default_tile_size); |
| gfx::Size layer_bounds(default_tile_size.width() * 4, |
| default_tile_size.height() * 4); |
| @@ -1514,6 +1514,14 @@ TEST_F(PictureLayerImplTest, TilingWithoutGpuRasterization) { |
| 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
| // Should have a low-res and a high-res tiling. |
| ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings()); |
| + |
| + pending_layer_->SetUseGpuRasterization(true); |
| + EXPECT_TRUE(pending_layer_->ShouldUseGpuRasterization()); |
| + EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings()); |
| + pending_layer_->CalculateContentsScale( |
| + 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
| + // Should only have the high-res tiling. |
| + ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings()); |
| } |
| TEST_F(PictureLayerImplTest, NoTilingIfDoesNotDrawContent) { |
| @@ -1629,68 +1637,6 @@ TEST_F(DeferredInitPictureLayerImplTest, |
| host_impl_.active_tree()->UpdateDrawProperties(); |
| } |
| -class HybridRasterizationPictureLayerImplTest : public PictureLayerImplTest { |
|
ajuma
2014/04/07 17:38:25
We'll need to keep this class -- a couple more tes
|
| - public: |
| - HybridRasterizationPictureLayerImplTest() |
| - : PictureLayerImplTest(HybridRasterizationSettings()) {} |
| -}; |
| - |
| -TEST_F(HybridRasterizationPictureLayerImplTest, Tiling) { |
| - gfx::Size default_tile_size(host_impl_.settings().default_tile_size); |
| - gfx::Size layer_bounds(default_tile_size.width() * 4, |
| - default_tile_size.height() * 4); |
| - float result_scale_x, result_scale_y; |
| - gfx::Size result_bounds; |
| - |
| - SetupDefaultTrees(layer_bounds); |
| - EXPECT_FALSE(pending_layer_->ShouldUseGpuRasterization()); |
| - EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings()); |
| - pending_layer_->CalculateContentsScale( |
| - 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
| - // Should have a low-res and a high-res tiling. |
| - ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings()); |
| - |
| - pending_layer_->SetHasGpuRasterizationHint(true); |
| - EXPECT_TRUE(pending_layer_->ShouldUseGpuRasterization()); |
| - EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings()); |
| - pending_layer_->CalculateContentsScale( |
| - 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
| - // Should only have the high-res tiling. |
| - ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings()); |
| -} |
| - |
| -class GpuRasterizationPictureLayerImplTest : public PictureLayerImplTest { |
| - public: |
| - GpuRasterizationPictureLayerImplTest() |
| - : PictureLayerImplTest(GpuRasterizationSettings()) {} |
| -}; |
| - |
| -TEST_F(GpuRasterizationPictureLayerImplTest, Tiling) { |
| - gfx::Size default_tile_size(host_impl_.settings().default_tile_size); |
| - gfx::Size layer_bounds(default_tile_size.width() * 4, |
| - default_tile_size.height() * 4); |
| - float result_scale_x, result_scale_y; |
| - gfx::Size result_bounds; |
| - |
| - SetupDefaultTrees(layer_bounds); |
| - pending_layer_->SetHasGpuRasterizationHint(true); |
| - EXPECT_TRUE(pending_layer_->ShouldUseGpuRasterization()); |
| - EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings()); |
| - pending_layer_->CalculateContentsScale( |
| - 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
| - // Should only have the high-res tiling. |
| - ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings()); |
| - |
| - pending_layer_->SetHasGpuRasterizationHint(false); |
| - EXPECT_TRUE(pending_layer_->ShouldUseGpuRasterization()); |
| - // Should still have the high-res tiling. |
| - EXPECT_EQ(1u, pending_layer_->tilings()->num_tilings()); |
| - pending_layer_->CalculateContentsScale( |
| - 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
| - // Should still only have the high-res tiling. |
| - ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings()); |
| -} |
| - |
| TEST_F(PictureLayerImplTest, LayerRasterTileIterator) { |
| gfx::Size tile_size(100, 100); |
| gfx::Size layer_bounds(1000, 1000); |