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

Unified Diff: cc/tiles/picture_layer_tiling_unittest.cc

Issue 2564433003: Add PictureLayerTiling pointer to Tile (Closed)
Patch Set: rebase Created 4 years 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/tiles/picture_layer_tiling.cc ('k') | cc/tiles/tile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/picture_layer_tiling_unittest.cc
diff --git a/cc/tiles/picture_layer_tiling_unittest.cc b/cc/tiles/picture_layer_tiling_unittest.cc
index 3291a33e1c93eb4f925c6cfd85c690ed410315b2..a861e87dbb4fefd539203087902593176cb86aa9 100644
--- a/cc/tiles/picture_layer_tiling_unittest.cc
+++ b/cc/tiles/picture_layer_tiling_unittest.cc
@@ -1062,5 +1062,32 @@ TEST_F(PictureLayerTilingIteratorTest, TightCover2) {
VerifyTilesExactlyCoverRect(dest_scale, gfx::Rect(10001, 2));
}
+TEST_F(PictureLayerTilingIteratorTest, TilesStoreTilings) {
+ gfx::Size bounds(200, 200);
+ Initialize(gfx::Size(100, 100), 1.f, bounds);
+ SetLiveRectAndVerifyTiles(gfx::Rect(bounds));
+
+ // Get all tiles and ensure they are associated with |tiling_|.
+ std::vector<Tile*> tiles = tiling_->AllTilesForTesting();
+ EXPECT_TRUE(tiles.size());
+ for (const auto* tile : tiles) {
+ EXPECT_EQ(tile->tiling(), tiling_.get());
+ }
+
+ // Create an active tiling, transfer tiles to that tiling, and ensure that
+ // the tiles have their tiling updated.
+ scoped_refptr<FakeRasterSource> raster_source =
+ FakeRasterSource::CreateFilled(bounds);
+ auto active_tiling = TestablePictureLayerTiling::Create(
+ ACTIVE_TREE, 1.f, raster_source, &client_, LayerTreeSettings());
+ active_tiling->set_resolution(HIGH_RESOLUTION);
+
+ active_tiling->TakeTilesAndPropertiesFrom(tiling_.get(),
+ Region(gfx::Rect(bounds)));
+ for (const auto* tile : tiles) {
+ EXPECT_EQ(tile->tiling(), active_tiling.get());
+ }
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/tiles/picture_layer_tiling.cc ('k') | cc/tiles/tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698