OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/time/time.h" | 5 #include "base/time/time.h" |
6 #include "cc/debug/lap_timer.h" | 6 #include "cc/debug/lap_timer.h" |
7 #include "cc/resources/raster_buffer.h" | 7 #include "cc/resources/raster_buffer.h" |
8 #include "cc/resources/tile.h" | 8 #include "cc/resources/tile.h" |
9 #include "cc/resources/tile_priority.h" | 9 #include "cc/resources/tile_priority.h" |
10 #include "cc/test/begin_frame_args_test.h" | 10 #include "cc/test/begin_frame_args_test.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Clear recycled tree. | 157 // Clear recycled tree. |
158 pending_tree->DetachLayerTree(); | 158 pending_tree->DetachLayerTree(); |
159 | 159 |
160 scoped_ptr<FakePictureLayerImpl> pending_layer = | 160 scoped_ptr<FakePictureLayerImpl> pending_layer = |
161 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_, pile); | 161 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_, pile); |
162 pending_layer->SetDrawsContent(true); | 162 pending_layer->SetDrawsContent(true); |
163 pending_tree->SetRootLayer(pending_layer.Pass()); | 163 pending_tree->SetRootLayer(pending_layer.Pass()); |
164 | 164 |
165 pending_root_layer_ = static_cast<FakePictureLayerImpl*>( | 165 pending_root_layer_ = static_cast<FakePictureLayerImpl*>( |
166 host_impl_.pending_tree()->LayerById(id_)); | 166 host_impl_.pending_tree()->LayerById(id_)); |
167 pending_root_layer_->DoPostCommitInitializationIfNeeded(); | |
168 } | 167 } |
169 | 168 |
170 void CreateHighLowResAndSetAllTilesVisible() { | 169 void CreateHighLowResAndSetAllTilesVisible() { |
171 // Active layer must get updated first so pending layer can share from it. | 170 // Active layer must get updated first so pending layer can share from it. |
172 active_root_layer_->CreateDefaultTilingsAndTiles(); | 171 active_root_layer_->CreateDefaultTilingsAndTiles(); |
173 active_root_layer_->SetAllTilesVisible(); | 172 active_root_layer_->SetAllTilesVisible(); |
174 pending_root_layer_->CreateDefaultTilingsAndTiles(); | 173 pending_root_layer_->CreateDefaultTilingsAndTiles(); |
175 pending_root_layer_->SetAllTilesVisible(); | 174 pending_root_layer_->SetAllTilesVisible(); |
176 } | 175 } |
177 | 176 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 FakePictureLayerImpl::CreateWithRasterSource( | 362 FakePictureLayerImpl::CreateWithRasterSource( |
364 host_impl_.pending_tree(), next_id, pile); | 363 host_impl_.pending_tree(), next_id, pile); |
365 layer->SetBounds(layer_bounds); | 364 layer->SetBounds(layer_bounds); |
366 layers.push_back(layer.get()); | 365 layers.push_back(layer.get()); |
367 pending_root_layer_->AddChild(layer.Pass()); | 366 pending_root_layer_->AddChild(layer.Pass()); |
368 | 367 |
369 FakePictureLayerImpl* fake_layer = | 368 FakePictureLayerImpl* fake_layer = |
370 static_cast<FakePictureLayerImpl*>(layers.back()); | 369 static_cast<FakePictureLayerImpl*>(layers.back()); |
371 | 370 |
372 fake_layer->SetDrawsContent(true); | 371 fake_layer->SetDrawsContent(true); |
373 fake_layer->DoPostCommitInitializationIfNeeded(); | |
374 fake_layer->CreateDefaultTilingsAndTiles(); | 372 fake_layer->CreateDefaultTilingsAndTiles(); |
375 ++next_id; | 373 ++next_id; |
376 } | 374 } |
377 | 375 |
378 return layers; | 376 return layers; |
379 } | 377 } |
380 | 378 |
381 GlobalStateThatImpactsTilePriority GlobalStateForTest() { | 379 GlobalStateThatImpactsTilePriority GlobalStateForTest() { |
382 GlobalStateThatImpactsTilePriority state; | 380 GlobalStateThatImpactsTilePriority state; |
383 gfx::Size tile_size = settings_.default_tile_size; | 381 gfx::Size tile_size = settings_.default_tile_size; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); | 486 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); |
489 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); | 487 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); |
490 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); | 488 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); |
491 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); | 489 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); |
492 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); | 490 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); |
493 } | 491 } |
494 | 492 |
495 } // namespace | 493 } // namespace |
496 | 494 |
497 } // namespace cc | 495 } // namespace cc |
OLD | NEW |