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 bac3aac38c18b842b198963e449c4d2c0114c47f..6c45b09514270066c7ed0b0c87758fdb2379b2e5 100644 |
--- a/cc/layers/picture_layer_impl_perftest.cc |
+++ b/cc/layers/picture_layer_impl_perftest.cc |
@@ -54,21 +54,22 @@ class PictureLayerImplPerfTest : public testing::Test { |
host_impl_.InitializeRenderer(output_surface_.get()); |
} |
- void SetupActiveTree(const gfx::Size& layer_bounds) { |
+ void SetupPendingTree(const gfx::Size& layer_bounds) { |
scoped_refptr<FakeDisplayListRasterSource> raster_source = |
FakeDisplayListRasterSource::CreateFilled(layer_bounds); |
- LayerTreeImpl* active_tree = host_impl_.active_tree(); |
- active_tree->DetachLayerTree(); |
+ host_impl_.CreatePendingTree(); |
+ LayerTreeImpl* pending_tree = host_impl_.pending_tree(); |
+ pending_tree->DetachLayerTree(); |
- scoped_ptr<FakePictureLayerImpl> active_layer = |
- FakePictureLayerImpl::CreateWithRasterSource(active_tree, 7, |
+ scoped_ptr<FakePictureLayerImpl> pending_layer = |
+ FakePictureLayerImpl::CreateWithRasterSource(pending_tree, 7, |
raster_source); |
- active_layer->SetDrawsContent(true); |
- active_layer->SetHasRenderSurface(true); |
- active_tree->SetRootLayer(active_layer.Pass()); |
+ pending_layer->SetDrawsContent(true); |
+ pending_layer->SetHasRenderSurface(true); |
+ pending_tree->SetRootLayer(pending_layer.Pass()); |
- active_layer_ = static_cast<FakePictureLayerImpl*>( |
- host_impl_.active_tree()->LayerById(7)); |
+ pending_layer_ = static_cast<FakePictureLayerImpl*>( |
+ host_impl_.pending_tree()->LayerById(7)); |
} |
void RunRasterQueueConstructAndIterateTest(const std::string& test_name, |
@@ -76,13 +77,13 @@ class PictureLayerImplPerfTest : public testing::Test { |
const gfx::Size& viewport_size) { |
host_impl_.SetViewportSize(viewport_size); |
bool update_lcd_text = false; |
- host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); |
+ host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
timer_.Reset(); |
do { |
int count = num_tiles; |
scoped_ptr<TilingSetRasterQueueAll> queue(new TilingSetRasterQueueAll( |
- active_layer_->picture_layer_tiling_set(), false)); |
+ pending_layer_->picture_layer_tiling_set(), false)); |
while (count--) { |
ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count; |
ASSERT_TRUE(queue->Top().tile()) << "count: " << count; |
@@ -98,15 +99,15 @@ class PictureLayerImplPerfTest : public testing::Test { |
void RunRasterQueueConstructTest(const std::string& test_name, |
const gfx::Rect& viewport) { |
host_impl_.SetViewportSize(viewport.size()); |
- active_layer_->PushScrollOffsetFromMainThreadAndClobberActiveValue( |
+ pending_layer_->PushScrollOffsetFromMainThread( |
gfx::ScrollOffset(viewport.x(), viewport.y())); |
bool update_lcd_text = false; |
- host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); |
+ host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
timer_.Reset(); |
do { |
scoped_ptr<TilingSetRasterQueueAll> queue(new TilingSetRasterQueueAll( |
- active_layer_->picture_layer_tiling_set(), false)); |
+ pending_layer_->picture_layer_tiling_set(), false)); |
timer_.NextLap(); |
} while (!timer_.HasTimeLimitExpired()); |
@@ -119,15 +120,14 @@ class PictureLayerImplPerfTest : public testing::Test { |
int num_tiles, |
const gfx::Size& viewport_size) { |
host_impl_.SetViewportSize(viewport_size); |
- active_layer_->MarkAllTilingsUsed(); |
bool update_lcd_text = false; |
- host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); |
+ host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
timer_.Reset(); |
do { |
int count = num_tiles; |
scoped_ptr<TilingSetEvictionQueue> queue(new TilingSetEvictionQueue( |
- active_layer_->picture_layer_tiling_set())); |
+ pending_layer_->picture_layer_tiling_set())); |
while (count--) { |
ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count; |
ASSERT_TRUE(queue->Top().tile()) << "count: " << count; |
@@ -144,16 +144,15 @@ class PictureLayerImplPerfTest : public testing::Test { |
void RunEvictionQueueConstructTest(const std::string& test_name, |
const gfx::Rect& viewport) { |
host_impl_.SetViewportSize(viewport.size()); |
- active_layer_->PushScrollOffsetFromMainThreadAndClobberActiveValue( |
+ pending_layer_->PushScrollOffsetFromMainThread( |
gfx::ScrollOffset(viewport.x(), viewport.y())); |
- active_layer_->MarkAllTilingsUsed(); |
bool update_lcd_text = false; |
- host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); |
+ host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
timer_.Reset(); |
do { |
scoped_ptr<TilingSetEvictionQueue> queue(new TilingSetEvictionQueue( |
- active_layer_->picture_layer_tiling_set())); |
+ pending_layer_->picture_layer_tiling_set())); |
timer_.NextLap(); |
} while (!timer_.HasTimeLimitExpired()); |
@@ -167,7 +166,7 @@ class PictureLayerImplPerfTest : public testing::Test { |
FakeImplProxy proxy_; |
scoped_ptr<OutputSurface> output_surface_; |
FakeLayerTreeHostImpl host_impl_; |
- FakePictureLayerImpl* active_layer_; |
+ FakePictureLayerImpl* pending_layer_; |
LapTimer timer_; |
private: |
@@ -175,15 +174,15 @@ class PictureLayerImplPerfTest : public testing::Test { |
}; |
TEST_F(PictureLayerImplPerfTest, TilingSetRasterQueueConstructAndIterate) { |
- SetupActiveTree(gfx::Size(10000, 10000)); |
+ SetupPendingTree(gfx::Size(10000, 10000)); |
float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; |
- active_layer_->AddTiling(low_res_factor); |
- active_layer_->AddTiling(0.3f); |
- active_layer_->AddTiling(0.7f); |
- active_layer_->AddTiling(1.0f); |
- active_layer_->AddTiling(2.0f); |
+ pending_layer_->AddTiling(low_res_factor); |
+ pending_layer_->AddTiling(0.3f); |
+ pending_layer_->AddTiling(0.7f); |
+ pending_layer_->AddTiling(1.0f); |
+ pending_layer_->AddTiling(2.0f); |
RunRasterQueueConstructAndIterateTest("32_100x100", 32, gfx::Size(100, 100)); |
RunRasterQueueConstructAndIterateTest("32_500x500", 32, gfx::Size(500, 500)); |
@@ -192,15 +191,15 @@ TEST_F(PictureLayerImplPerfTest, TilingSetRasterQueueConstructAndIterate) { |
} |
TEST_F(PictureLayerImplPerfTest, TilingSetRasterQueueConstruct) { |
- SetupActiveTree(gfx::Size(10000, 10000)); |
+ SetupPendingTree(gfx::Size(10000, 10000)); |
float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; |
- active_layer_->AddTiling(low_res_factor); |
- active_layer_->AddTiling(0.3f); |
- active_layer_->AddTiling(0.7f); |
- active_layer_->AddTiling(1.0f); |
- active_layer_->AddTiling(2.0f); |
+ pending_layer_->AddTiling(low_res_factor); |
+ pending_layer_->AddTiling(0.3f); |
+ pending_layer_->AddTiling(0.7f); |
+ pending_layer_->AddTiling(1.0f); |
+ pending_layer_->AddTiling(2.0f); |
RunRasterQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); |
RunRasterQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); |
@@ -208,16 +207,16 @@ TEST_F(PictureLayerImplPerfTest, TilingSetRasterQueueConstruct) { |
} |
TEST_F(PictureLayerImplPerfTest, TilingSetEvictionQueueConstructAndIterate) { |
- SetupActiveTree(gfx::Size(10000, 10000)); |
+ SetupPendingTree(gfx::Size(10000, 10000)); |
float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; |
std::vector<Tile*> all_tiles; |
- AddTiling(low_res_factor, active_layer_, &all_tiles); |
- AddTiling(0.3f, active_layer_, &all_tiles); |
- AddTiling(0.7f, active_layer_, &all_tiles); |
- AddTiling(1.0f, active_layer_, &all_tiles); |
- AddTiling(2.0f, active_layer_, &all_tiles); |
+ AddTiling(low_res_factor, pending_layer_, &all_tiles); |
+ AddTiling(0.3f, pending_layer_, &all_tiles); |
+ AddTiling(0.7f, pending_layer_, &all_tiles); |
+ AddTiling(1.0f, pending_layer_, &all_tiles); |
+ AddTiling(2.0f, pending_layer_, &all_tiles); |
ASSERT_TRUE(host_impl_.tile_manager() != nullptr); |
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); |
@@ -233,16 +232,16 @@ TEST_F(PictureLayerImplPerfTest, TilingSetEvictionQueueConstructAndIterate) { |
} |
TEST_F(PictureLayerImplPerfTest, TilingSetEvictionQueueConstruct) { |
- SetupActiveTree(gfx::Size(10000, 10000)); |
+ SetupPendingTree(gfx::Size(10000, 10000)); |
float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; |
std::vector<Tile*> all_tiles; |
- AddTiling(low_res_factor, active_layer_, &all_tiles); |
- AddTiling(0.3f, active_layer_, &all_tiles); |
- AddTiling(0.7f, active_layer_, &all_tiles); |
- AddTiling(1.0f, active_layer_, &all_tiles); |
- AddTiling(2.0f, active_layer_, &all_tiles); |
+ AddTiling(low_res_factor, pending_layer_, &all_tiles); |
+ AddTiling(0.3f, pending_layer_, &all_tiles); |
+ AddTiling(0.7f, pending_layer_, &all_tiles); |
+ AddTiling(1.0f, pending_layer_, &all_tiles); |
+ AddTiling(2.0f, pending_layer_, &all_tiles); |
ASSERT_TRUE(host_impl_.tile_manager() != nullptr); |
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); |