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

Unified Diff: cc/resources/picture_layer_tiling_unittest.cc

Issue 441033002: cc: Clear tile priorities when tiling is reset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update 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') | no next file » | 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 9566489b81934924850434ca2ae68347412870dd..f0e8c6a0c90d0e793a1f64064b213ba6ee4100f9 100644
--- a/cc/resources/picture_layer_tiling_unittest.cc
+++ b/cc/resources/picture_layer_tiling_unittest.cc
@@ -1866,5 +1866,39 @@ TEST(UpdateTilePrioritiesTest, RotationMotion) {
EXPECT_EQ(TilePriority::NOW, priority.priority_bin);
}
+TEST(PictureLayerTilingTest, ResetClearsPriorities) {
+ FakePictureLayerTilingClient client;
+ scoped_ptr<TestablePictureLayerTiling> tiling;
+
+ client.SetTileSize(gfx::Size(100, 100));
+ client.set_tree(ACTIVE_TREE);
+ tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale
+ gfx::Size(100, 100),
+ &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
+
+ std::vector<scoped_refptr<Tile> > tiles = tiling->AllRefTilesForTesting();
+ ASSERT_GT(tiles.size(), 0u);
+ for (std::vector<scoped_refptr<Tile> >::const_iterator it = tiles.begin();
+ it != tiles.end();
+ ++it) {
+ EXPECT_NE(TilePriority(), (*it)->priority(ACTIVE_TREE));
+ }
+
+ tiling->Reset();
+ for (std::vector<scoped_refptr<Tile> >::const_iterator it = tiles.begin();
+ it != tiles.end();
+ ++it) {
+ EXPECT_EQ(TilePriority(), (*it)->priority(ACTIVE_TREE));
+ }
+ tiles.clear();
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/resources/picture_layer_tiling.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698