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

Unified Diff: cc/resources/picture_layer_tiling_perftest.cc

Issue 183663003: cc: Add tiling raster tile iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/resources/picture_layer_tiling.cc ('k') | cc/resources/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0e015b17dc0333a4c3861643600ebb1f309bf75b 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,
+ int num_tiles,
+ const gfx::Rect& viewport) {
+ start_time_ = base::TimeTicks();
+ num_runs_ = 0;
+
+ gfx::Size bounds(10000, 10000);
+ picture_layer_tiling_ =
+ PictureLayerTiling::Create(1, bounds, &picture_layer_tiling_client_);
+ picture_layer_tiling_->UpdateTilePriorities(
+ ACTIVE_TREE, viewport, 1.0f, 1.0);
+ do {
+ int count = num_tiles;
+ for (PictureLayerTiling::TilingRasterTileIterator it(
+ picture_layer_tiling_.get(), ACTIVE_TREE);
+ it && count;
+ ++it) {
+ --count;
+ }
+ } 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,13 @@ TEST_F(PictureLayerTilingPerfTest, UpdateTilePriorities) {
RunUpdateTilePrioritiesScrollingTest("perspective", transform);
}
+TEST_F(PictureLayerTilingPerfTest, TilingRasterTileIterator) {
+ RunTilingRasterTileIteratorTest("32_100x100", 32, gfx::Rect(0, 0, 100, 100));
+ RunTilingRasterTileIteratorTest("32_500x500", 32, gfx::Rect(0, 0, 500, 500));
+ RunTilingRasterTileIteratorTest("64_100x100", 64, gfx::Rect(0, 0, 100, 100));
+ RunTilingRasterTileIteratorTest("64_500x500", 64, gfx::Rect(0, 0, 500, 500));
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/resources/picture_layer_tiling.cc ('k') | cc/resources/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698