| 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 9253ce54e77261e77a260187f4a0dd390c7c504b..064e43d620112cf8287099390fbdd455bc03ec5b 100644
|
| --- a/cc/resources/picture_layer_tiling_perftest.cc
|
| +++ b/cc/resources/picture_layer_tiling_perftest.cc
|
| @@ -67,7 +67,6 @@ class PictureLayerTilingPerfTest : public testing::Test {
|
| start_time_ = base::TimeTicks();
|
| num_runs_ = 0;
|
|
|
| - gfx::Size layer_bounds(50 * 256, 50 * 256);
|
| gfx::Rect viewport_rect(0, 0, 1024, 768);
|
| do {
|
| picture_layer_tiling_->UpdateTilePriorities(
|
| @@ -87,7 +86,6 @@ class PictureLayerTilingPerfTest : public testing::Test {
|
| start_time_ = base::TimeTicks();
|
| num_runs_ = 0;
|
|
|
| - gfx::Size layer_bounds(50 * 256, 50 * 256);
|
| gfx::Size viewport_size(1024, 768);
|
| gfx::Rect viewport_rect(viewport_size);
|
| int xoffsets[] = {10, 0, -10, 0};
|
| @@ -118,6 +116,35 @@ class PictureLayerTilingPerfTest : public testing::Test {
|
| true);
|
| }
|
|
|
| + void RunTilingRasterTileIteratorTest(const std::string& test_name,
|
| + const gfx::Size& bounds,
|
| + const gfx::Rect& first_viewport,
|
| + const gfx::Rect& second_viewport) {
|
| + start_time_ = base::TimeTicks();
|
| + num_runs_ = 0;
|
| +
|
| + picture_layer_tiling_ =
|
| + PictureLayerTiling::Create(1, bounds, &picture_layer_tiling_client_);
|
| + gfx::Rect viewports[2] = {first_viewport, second_viewport};
|
| +
|
| + do {
|
| + picture_layer_tiling_->UpdateTilePriorities(
|
| + ACTIVE_TREE, viewports[num_runs_ % 2], 1.f, num_runs_ + 1);
|
| + for (PictureLayerTiling::TilingRasterTileIterator it(
|
| + picture_layer_tiling_.get());
|
| + it;
|
| + ++it)
|
| + continue;
|
| + } while (DidRun());
|
| +
|
| + perf_test::PrintResult("tiling_raster_tile_iterator",
|
| + "",
|
| + test_name,
|
| + num_runs_ / elapsed_.InSecondsF(),
|
| + "runs/s",
|
| + true);
|
| + }
|
| +
|
| private:
|
| FakePictureLayerTilingClient picture_layer_tiling_client_;
|
| scoped_ptr<PictureLayerTiling> picture_layer_tiling_;
|
| @@ -158,6 +185,41 @@ TEST_F(PictureLayerTilingPerfTest, UpdateTilePriorities) {
|
| RunUpdateTilePrioritiesScrollingTest("perspective", transform);
|
| }
|
|
|
| +TEST_F(PictureLayerTilingPerfTest, TilingRasterTileIterator) {
|
| + RunTilingRasterTileIteratorTest("1k_bounds_100_vp_stationary",
|
| + gfx::Size(1000, 1000),
|
| + gfx::Rect(0, 0, 100, 100),
|
| + gfx::Rect(0, 0, 100, 100));
|
| + RunTilingRasterTileIteratorTest("1k_bounds_100_vp_moving",
|
| + gfx::Size(1000, 1000),
|
| + gfx::Rect(0, 0, 100, 100),
|
| + gfx::Rect(0, 100, 100, 100));
|
| + RunTilingRasterTileIteratorTest("1k_bounds_500_vp_stationary",
|
| + gfx::Size(1000, 1000),
|
| + gfx::Rect(0, 0, 500, 500),
|
| + gfx::Rect(0, 0, 500, 500));
|
| + RunTilingRasterTileIteratorTest("1k_bounds_500_vp_moving",
|
| + gfx::Size(1000, 1000),
|
| + gfx::Rect(0, 0, 500, 500),
|
| + gfx::Rect(0, 100, 500, 500));
|
| + RunTilingRasterTileIteratorTest("2k_bounds_100_vp_stationary",
|
| + gfx::Size(2000, 2000),
|
| + gfx::Rect(0, 0, 100, 100),
|
| + gfx::Rect(0, 0, 100, 100));
|
| + RunTilingRasterTileIteratorTest("2k_bounds_100_vp_moving",
|
| + gfx::Size(2000, 2000),
|
| + gfx::Rect(0, 0, 100, 100),
|
| + gfx::Rect(0, 100, 100, 100));
|
| + RunTilingRasterTileIteratorTest("2k_bounds_500_vp_stationary",
|
| + gfx::Size(2000, 2000),
|
| + gfx::Rect(0, 0, 500, 500),
|
| + gfx::Rect(0, 0, 500, 500));
|
| + RunTilingRasterTileIteratorTest("2k_bounds_500_vp_moving",
|
| + gfx::Size(2000, 2000),
|
| + gfx::Rect(0, 0, 500, 500),
|
| + gfx::Rect(0, 100, 500, 500));
|
| +}
|
| +
|
| } // namespace
|
|
|
| } // namespace cc
|
|
|