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

Unified Diff: cc/resources/picture_layer_tiling_unittest.cc

Issue 502453003: cc: Remove tiles from recycle tree that were deleted on active. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +address comment Created 6 years, 4 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/resources/picture_layer_tiling.cc ('k') | cc/test/fake_picture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/resources/picture_layer_tiling.cc ('k') | cc/test/fake_picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698