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

Unified Diff: cc/layers/picture_layer_impl_perftest.cc

Issue 742343002: cc: Move LayerRasterTileIterator to a separate file and make it a queue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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_impl.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_perftest.cc
diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc
index bfb5703fc59883bdac814d401981dcb680ae4581..074467f05138e8fa7a3d5ff91dd0786b1dbde1ba 100644
--- a/cc/layers/picture_layer_impl_perftest.cc
+++ b/cc/layers/picture_layer_impl_perftest.cc
@@ -67,21 +67,21 @@ class PictureLayerImplPerfTest : public testing::Test {
pending_layer_->DoPostCommitInitializationIfNeeded();
}
- void RunRasterIteratorConstructAndIterateTest(
- const std::string& test_name,
- int num_tiles,
- const gfx::Size& viewport_size) {
+ void RunRasterQueueConstructAndIterateTest(const std::string& test_name,
+ int num_tiles,
+ const gfx::Size& viewport_size) {
host_impl_.SetViewportSize(viewport_size);
host_impl_.pending_tree()->UpdateDrawProperties();
timer_.Reset();
do {
int count = num_tiles;
- PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false);
+ scoped_ptr<TilingSetRasterQueue> queue =
+ pending_layer_->CreateRasterQueue(false);
while (count--) {
- ASSERT_TRUE(it) << "count: " << count;
- ASSERT_TRUE(*it != nullptr) << "count: " << count;
- ++it;
+ ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count;
+ ASSERT_TRUE(queue->Top() != nullptr) << "count: " << count;
+ queue->Pop();
}
timer_.NextLap();
} while (!timer_.HasTimeLimitExpired());
@@ -94,8 +94,8 @@ class PictureLayerImplPerfTest : public testing::Test {
true);
}
- void RunRasterIteratorConstructTest(const std::string& test_name,
- const gfx::Rect& viewport) {
+ void RunRasterQueueConstructTest(const std::string& test_name,
+ const gfx::Rect& viewport) {
host_impl_.SetViewportSize(viewport.size());
pending_layer_->SetScrollOffset(
gfx::ScrollOffset(viewport.x(), viewport.y()));
@@ -103,7 +103,8 @@ class PictureLayerImplPerfTest : public testing::Test {
timer_.Reset();
do {
- PictureLayerImpl::LayerRasterTileIterator it(pending_layer_, false);
+ scoped_ptr<TilingSetRasterQueue> queue =
+ pending_layer_->CreateRasterQueue(false);
timer_.NextLap();
} while (!timer_.HasTimeLimitExpired());
@@ -186,6 +187,7 @@ class PictureLayerImplPerfTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(PictureLayerImplPerfTest);
};
+// TODO(vmpstr): Rename these tests once the perf numbers are in.
TEST_F(PictureLayerImplPerfTest, LayerRasterTileIteratorConstructAndIterate) {
SetupPendingTree(gfx::Size(10000, 10000), gfx::Size(256, 256));
@@ -197,16 +199,13 @@ TEST_F(PictureLayerImplPerfTest, LayerRasterTileIteratorConstructAndIterate) {
pending_layer_->AddTiling(1.0f);
pending_layer_->AddTiling(2.0f);
- RunRasterIteratorConstructAndIterateTest(
- "32_100x100", 32, gfx::Size(100, 100));
- RunRasterIteratorConstructAndIterateTest(
- "32_500x500", 32, gfx::Size(500, 500));
- RunRasterIteratorConstructAndIterateTest(
- "64_100x100", 64, gfx::Size(100, 100));
- RunRasterIteratorConstructAndIterateTest(
- "64_500x500", 64, gfx::Size(500, 500));
+ RunRasterQueueConstructAndIterateTest("32_100x100", 32, gfx::Size(100, 100));
+ RunRasterQueueConstructAndIterateTest("32_500x500", 32, gfx::Size(500, 500));
+ RunRasterQueueConstructAndIterateTest("64_100x100", 64, gfx::Size(100, 100));
+ RunRasterQueueConstructAndIterateTest("64_500x500", 64, gfx::Size(500, 500));
}
+// TODO(vmpstr): Rename these tests once the perf numbers are in.
TEST_F(PictureLayerImplPerfTest, LayerRasterTileIteratorConstruct) {
SetupPendingTree(gfx::Size(10000, 10000), gfx::Size(256, 256));
@@ -218,11 +217,9 @@ TEST_F(PictureLayerImplPerfTest, LayerRasterTileIteratorConstruct) {
pending_layer_->AddTiling(1.0f);
pending_layer_->AddTiling(2.0f);
- RunRasterIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
- RunRasterIteratorConstructTest("5000_0_100x100",
- gfx::Rect(5000, 0, 100, 100));
- RunRasterIteratorConstructTest("9999_0_100x100",
- gfx::Rect(9999, 0, 100, 100));
+ RunRasterQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
+ RunRasterQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100));
+ RunRasterQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100));
}
// TODO(e_hakkinen): Rename these tests once the perf numbers are in.
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698