Chromium Code Reviews| Index: cc/resources/picture_layer_tiling_unittest.cc |
| diff --git a/cc/resources/picture_layer_tiling_unittest.cc b/cc/resources/picture_layer_tiling_unittest.cc |
| index a8caf48904b835f7e1c8905379fbedcfe6b1fb85..5d13aecca14d773fe3e6a0eb82ac44ab60e8074d 100644 |
| --- a/cc/resources/picture_layer_tiling_unittest.cc |
| +++ b/cc/resources/picture_layer_tiling_unittest.cc |
| @@ -1948,5 +1948,66 @@ TEST(PictureLayerTilingTest, ResetClearsPriorities) { |
| tiles.clear(); |
| } |
| +TEST(PictureLayerTilingTest, RecycledTilesCleared) { |
|
enne (OOO)
2014/08/22 23:01:05
For forgetful future ennes, could you leave a comm
vmpstr
2014/08/25 18:41:00
Done.
|
| + FakePictureLayerTilingClient client; |
| + scoped_ptr<TestablePictureLayerTiling> tiling; |
| + |
| + client.SetTileSize(gfx::Size(100, 100)); |
| + client.set_tree(ACTIVE_TREE); |
| + client.set_max_tiles_for_interest_area(10); |
| + tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| + gfx::Size(10000, 10000), |
| + &client); |
| + tiling->UpdateTilePriorities(ACTIVE_TREE, |
| + gfx::Rect(0, 0, 100, 100), |
| + 1.0f, |
| + 1.0f, |
| + NULL, // occlusion tracker |
| + NULL, // render target |
| + gfx::Transform()); // draw transform |
| + |
| + FakePictureLayerTilingClient second_client; |
| + second_client.SetTileSize(gfx::Size(100, 100)); |
| + second_client.set_tree(PENDING_TREE); |
| + second_client.set_twin_tiling(tiling.get()); |
| + second_client.set_max_tiles_for_interest_area(10); |
| + |
| + scoped_ptr<TestablePictureLayerTiling> second_tiling; |
| + second_tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| + gfx::Size(10000, 10000), |
| + &second_client); |
| + second_tiling->UpdateTilePriorities(ACTIVE_TREE, |
| + gfx::Rect(0, 0, 100, 100), |
| + 1.0f, |
| + 1.0f, |
| + NULL, // occlusion tracker |
| + NULL, // render target |
| + gfx::Transform()); // draw transform |
| + |
| + ASSERT_TRUE(tiling->TileAt(0, 0)); |
| + ASSERT_EQ(tiling->TileAt(0, 0), second_tiling->TileAt(0, 0)); |
| + |
| + client.set_twin_tiling(NULL); |
| + client.set_recycled_twin_tiling(second_tiling.get()); |
| + second_client.set_twin_tiling(NULL); |
| + tiling->UpdateTilePriorities(ACTIVE_TREE, |
| + gfx::Rect(9000, 9000, 100, 100), |
| + 1.0f, |
| + 2.0, |
| + NULL, // occlusion tracker |
| + NULL, // render target |
| + gfx::Transform()); // draw transform |
| + EXPECT_FALSE(tiling->TileAt(0, 0)); |
| + tiling->UpdateTilePriorities(ACTIVE_TREE, |
| + gfx::Rect(0, 0, 100, 100), |
| + 1.0f, |
| + 3.0, |
| + NULL, // occlusion tracker |
| + NULL, // render target |
| + gfx::Transform()); // draw transform |
| + EXPECT_TRUE(tiling->TileAt(0, 0)); |
| + EXPECT_FALSE(second_tiling->TileAt(0, 0)); |
| +} |
| + |
| } // namespace |
| } // namespace cc |