diff options
author | e.hakkinen <e.hakkinen@samsung.com> | 2014-11-27 01:41:36 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-27 09:42:02 +0000 |
commit | ada8f5dae0fd99ef5a74fecdff1b91dacd7183b3 (patch) | |
tree | 68ff7f816bc66cc8675e1ebff8161a8d2dee263a /cc/layers/picture_layer_impl_perftest.cc | |
parent | 3e894c9f7fb0bc6d8c812274d60b83811969aef2 (diff) | |
download | chromium_src-ada8f5dae0fd99ef5a74fecdff1b91dacd7183b3.zip chromium_src-ada8f5dae0fd99ef5a74fecdff1b91dacd7183b3.tar.gz chromium_src-ada8f5dae0fd99ef5a74fecdff1b91dacd7183b3.tar.bz2 |
cc: Move LayerEvictionTileIterator to a separate file and make it a queue
In line with LayerRasterTileIterator patch, this patch removes
PictureLayerImpl::LayerEvictionTileIterator, moves it to a separate
file, renames it to TilingSetEvictionQueue, makes its functionality be
more queue-like instead of iterator-like and merges
PictureLayerTiling::TilingEvictionTileIterator into it (as those two
iterators were so tightly coupled).
Also, this patch adds a PLI::CreateEvictionQueue to get a eviction queue
for the layer.
This hides a bit more details of PLTS from PLI and avoid duplicating
eviction category handling in multiple different iterator classes.
Review URL: https://codereview.chromium.org/741683003
Cr-Commit-Position: refs/heads/master@{#305972}
Diffstat (limited to 'cc/layers/picture_layer_impl_perftest.cc')
-rw-r--r-- | cc/layers/picture_layer_impl_perftest.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc index 1f98a68..bfb5703 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 |