Index: cc/resources/picture_layer_tiling_perftest.cc |
diff --git a/cc/resources/picture_layer_tiling_perftest.cc b/cc/resources/picture_layer_tiling_perftest.cc |
index a610c1ea28e9a331aa9c9f0982362b0bf54dde61..9f4f274e62d91fbf63368cdcbe15fc126cf7fc26 100644 |
--- a/cc/resources/picture_layer_tiling_perftest.cc |
+++ b/cc/resources/picture_layer_tiling_perftest.cc |
@@ -112,6 +112,29 @@ class PictureLayerTilingPerfTest : public testing::Test { |
true); |
} |
+ void RunTilingRasterTileIteratorConstructionTest(const std::string& test_name, |
+ const gfx::Rect& viewport) { |
+ gfx::Size bounds(viewport.size()); |
+ picture_layer_tiling_ = |
+ PictureLayerTiling::Create(1, bounds, &picture_layer_tiling_client_); |
+ picture_layer_tiling_->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); |
+ |
+ timer_.Reset(); |
+ do { |
+ PictureLayerTiling::TilingRasterTileIterator it( |
+ picture_layer_tiling_.get(), ACTIVE_TREE); |
+ timer_.NextLap(); |
+ } while (!timer_.HasTimeLimitExpired()); |
+ |
+ perf_test::PrintResult("tiling_raster_tile_iterator_construction", |
+ "", |
+ test_name, |
+ timer_.LapsPerSecond(), |
+ "runs/s", |
+ true); |
+ } |
+ |
void RunTilingRasterTileIteratorTest(const std::string& test_name, |
int num_tiles, |
const gfx::Rect& viewport) { |
@@ -179,6 +202,17 @@ TEST_F(PictureLayerTilingPerfTest, UpdateTilePriorities) { |
RunUpdateTilePrioritiesScrollingTest("perspective", transform); |
} |
+TEST_F(PictureLayerTilingPerfTest, TilingRasterTileIteratorConstruction) { |
+ RunTilingRasterTileIteratorConstructionTest("0_0_100x100", |
+ gfx::Rect(0, 0, 100, 100)); |
+ RunTilingRasterTileIteratorConstructionTest("50_0_100x100", |
+ gfx::Rect(50, 0, 100, 100)); |
+ RunTilingRasterTileIteratorConstructionTest("100_0_100x100", |
+ gfx::Rect(100, 0, 100, 100)); |
+ RunTilingRasterTileIteratorConstructionTest("150_0_100x100", |
+ gfx::Rect(150, 0, 100, 100)); |
+} |
+ |
TEST_F(PictureLayerTilingPerfTest, TilingRasterTileIterator) { |
RunTilingRasterTileIteratorTest("32_100x100", 32, gfx::Rect(0, 0, 100, 100)); |
RunTilingRasterTileIteratorTest("32_500x500", 32, gfx::Rect(0, 0, 500, 500)); |