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

Unified Diff: cc/layers/picture_layer_unittest.cc

Issue 666573002: CC: Decouple tile-grid-size from tile-size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
Index: cc/layers/picture_layer_unittest.cc
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc
index 0e3d8fa8ec350956cbf9125040b5c033e2ff3f07..ab8532d32a0f2b3ffe32de8b8f65972901af0479 100644
--- a/cc/layers/picture_layer_unittest.cc
+++ b/cc/layers/picture_layer_unittest.cc
@@ -101,5 +101,23 @@ TEST(PictureLayerTest, RecordingModes) {
EXPECT_EQ(Picture::RECORD_WITH_SKRECORD, layer->RecordingMode());
}
+TEST(PictureLayerTest, UseTileGridSize) {
+ LayerTreeSettings settings;
+ settings.default_tile_grid_size = gfx::Size(123, 123);
+
+ MockContentLayerClient client;
+ scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client);
+ FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&host_client, settings);
+ host->SetRootLayer(layer);
+
+ // Tile-grid is set according to its setting.
+ SkTileGridFactory::TileGridInfo info =
+ layer->GetPicturePileForTesting()->GetTileGridInfoForTesting();
+ EXPECT_EQ(info.fTileInterval.width(), 123 - 2 * info.fMargin.width());
+ EXPECT_EQ(info.fTileInterval.height(), 123 - 2 * info.fMargin.height());
+}
+
} // namespace
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698