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

Unified Diff: cc/layers/picture_layer_impl_perftest.cc

Issue 741683003: cc: Move LayerEvictionTileIterator 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, 1 month 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 1f98a687df496a5dc2205fed8ac13e3bb051c7cd..bfb5703fc59883bdac814d401981dcb680ae4581 100644
--- a/cc/layers/picture_layer_impl_perftest.cc
+++ b/cc/layers/picture_layer_impl_perftest.cc
@@ -115,7 +115,7 @@ class PictureLayerImplPerfTest : public testing::Test {
true);
}
- void RunEvictionIteratorConstructAndIterateTest(
+ void RunEvictionQueueConstructAndIterateTest(
const std::string& test_name,
int num_tiles,
const gfx::Size& viewport_size) {
@@ -129,12 +129,12 @@ class PictureLayerImplPerfTest : public testing::Test {
timer_.Reset();
do {
int count = num_tiles;
- PictureLayerImpl::LayerEvictionTileIterator it(
- pending_layer_, priorities[priority_count]);
+ scoped_ptr<TilingSetEvictionQueue> queue =
+ pending_layer_->CreateEvictionQueue(priorities[priority_count]);
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();
}
priority_count = (priority_count + 1) % arraysize(priorities);
timer_.NextLap();
@@ -148,8 +148,8 @@ class PictureLayerImplPerfTest : public testing::Test {
true);
}
- void RunEvictionIteratorConstructTest(const std::string& test_name,
- const gfx::Rect& viewport) {
+ void RunEvictionQueueConstructTest(const std::string& test_name,
+ const gfx::Rect& viewport) {
host_impl_.SetViewportSize(viewport.size());
pending_layer_->SetScrollOffset(
gfx::ScrollOffset(viewport.x(), viewport.y()));
@@ -161,8 +161,8 @@ class PictureLayerImplPerfTest : public testing::Test {
int priority_count = 0;
timer_.Reset();
do {
- PictureLayerImpl::LayerEvictionTileIterator it(
- pending_layer_, priorities[priority_count]);
+ scoped_ptr<TilingSetEvictionQueue> queue =
+ pending_layer_->CreateEvictionQueue(priorities[priority_count]);
priority_count = (priority_count + 1) % arraysize(priorities);
timer_.NextLap();
} while (!timer_.HasTimeLimitExpired());
@@ -225,6 +225,7 @@ TEST_F(PictureLayerImplPerfTest, LayerRasterTileIteratorConstruct) {
gfx::Rect(9999, 0, 100, 100));
}
+// TODO(e_hakkinen): Rename these tests once the perf numbers are in.
TEST_F(PictureLayerImplPerfTest, LayerEvictionTileIteratorConstructAndIterate) {
SetupPendingTree(gfx::Size(10000, 10000), gfx::Size(256, 256));
@@ -240,16 +241,17 @@ TEST_F(PictureLayerImplPerfTest, LayerEvictionTileIteratorConstructAndIterate) {
ASSERT_TRUE(host_impl_.tile_manager() != nullptr);
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles);
- RunEvictionIteratorConstructAndIterateTest(
+ RunEvictionQueueConstructAndIterateTest(
"32_100x100", 32, gfx::Size(100, 100));
- RunEvictionIteratorConstructAndIterateTest(
+ RunEvictionQueueConstructAndIterateTest(
"32_500x500", 32, gfx::Size(500, 500));
- RunEvictionIteratorConstructAndIterateTest(
+ RunEvictionQueueConstructAndIterateTest(
"64_100x100", 64, gfx::Size(100, 100));
- RunEvictionIteratorConstructAndIterateTest(
+ RunEvictionQueueConstructAndIterateTest(
"64_500x500", 64, gfx::Size(500, 500));
}
+// TODO(e_hakkinen): Rename these tests once the perf numbers are in.
TEST_F(PictureLayerImplPerfTest, LayerEvictionTileIteratorConstruct) {
SetupPendingTree(gfx::Size(10000, 10000), gfx::Size(256, 256));
@@ -265,11 +267,9 @@ TEST_F(PictureLayerImplPerfTest, LayerEvictionTileIteratorConstruct) {
ASSERT_TRUE(host_impl_.tile_manager() != nullptr);
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles);
- RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
- RunEvictionIteratorConstructTest("5000_0_100x100",
- gfx::Rect(5000, 0, 100, 100));
- RunEvictionIteratorConstructTest("9999_0_100x100",
- gfx::Rect(9999, 0, 100, 100));
+ RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100));
+ RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100));
+ RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100));
}
} // namespace
« 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