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..00fdeac427515c3cce8bec9b44141ed7f7284336 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(), ACTIVE_TREE); |
+ it; |
+ ++it) |
+ continue; |
+ } while (DidRun()); |
+ |
+ perf_test::PrintResult("tiling_raster_tile_iterator", |
+ "", |
+ test_name, |
+ num_runs_ / elapsed_.InSecondsF(), |
+ "runs/s", |
epenner
2014/03/06 10:21:40
Again no need to change if you don't want, but I'm
vmpstr
2014/03/07 18:22:23
Hmm, that's a good point. I mean looking at our pe
epennerAtGoogle
2014/03/11 19:04:50
I'm sure you jest, but I'm not sure in which direc
|
+ 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) { |
enne (OOO)
2014/03/06 02:30:45
This is a little weird. Isn't this an UpdateTileP
epenner
2014/03/06 10:21:40
Hmm, to represent final performance here, could we
vmpstr
2014/03/07 18:22:23
Yeah, but I'd prefer to do that at the LayerRaster
vmpstr
2014/03/07 18:22:23
This tests calls update tile priorities (to create
enne (OOO)
2014/03/10 21:36:30
But in the end state we're not going to iterate th
epennerAtGoogle
2014/03/11 19:04:50
I wanted to mention another thing I thought of her
|
+ 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 |