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

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: Rebase. 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
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_unittest.cc
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc
index 545b332e047e16ae5202c45a456b3699b7be9d9b..265d4cf3e5cf75f8120a3eebb92719c9161d892a 100644
--- a/cc/layers/picture_layer_unittest.cc
+++ b/cc/layers/picture_layer_unittest.cc
@@ -84,5 +84,23 @@ TEST(PictureLayerTest, SuitableForGpuRasterization) {
EXPECT_FALSE(layer->IsSuitableForGpuRasterization());
}
+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
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698