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/location.h" | 5 #include "base/location.h" |
6 #include "base/thread_task_runner_handle.h" | 6 #include "base/thread_task_runner_handle.h" |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "cc/debug/lap_timer.h" | 8 #include "cc/debug/lap_timer.h" |
9 #include "cc/resources/raster_buffer.h" | 9 #include "cc/resources/raster_buffer.h" |
10 #include "cc/resources/tile.h" | 10 #include "cc/resources/tile.h" |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 void RunPrepareTilesTest(const std::string& test_name, | 383 void RunPrepareTilesTest(const std::string& test_name, |
384 int layer_count, | 384 int layer_count, |
385 int approximate_tile_count_per_layer) { | 385 int approximate_tile_count_per_layer) { |
386 std::vector<FakePictureLayerImpl*> layers = | 386 std::vector<FakePictureLayerImpl*> layers = |
387 CreateLayers(layer_count, approximate_tile_count_per_layer); | 387 CreateLayers(layer_count, approximate_tile_count_per_layer); |
388 timer_.Reset(); | 388 timer_.Reset(); |
389 bool resourceless_software_draw = false; | 389 bool resourceless_software_draw = false; |
390 do { | 390 do { |
391 BeginFrameArgs args = | 391 BeginFrameArgs args = |
392 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); | 392 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
393 host_impl_.UpdateCurrentBeginFrameArgs(args); | 393 host_impl_.WillBeginImplFrame(args); |
394 for (const auto& layer : layers) | 394 for (const auto& layer : layers) |
395 layer->UpdateTiles(resourceless_software_draw); | 395 layer->UpdateTiles(resourceless_software_draw); |
396 | 396 |
397 GlobalStateThatImpactsTilePriority global_state(GlobalStateForTest()); | 397 GlobalStateThatImpactsTilePriority global_state(GlobalStateForTest()); |
398 tile_manager()->PrepareTiles(global_state); | 398 tile_manager()->PrepareTiles(global_state); |
399 tile_manager()->UpdateVisibleTiles(global_state); | 399 tile_manager()->UpdateVisibleTiles(global_state); |
400 timer_.NextLap(); | 400 timer_.NextLap(); |
401 host_impl_.ResetCurrentBeginFrameArgsForNextFrame(); | 401 host_impl_.DidBeginImplFrameDeadline(); |
402 } while (!timer_.HasTimeLimitExpired()); | 402 } while (!timer_.HasTimeLimitExpired()); |
403 | 403 |
404 perf_test::PrintResult("prepare_tiles", "", test_name, | 404 perf_test::PrintResult("prepare_tiles", "", test_name, |
405 timer_.LapsPerSecond(), "runs/s", true); | 405 timer_.LapsPerSecond(), "runs/s", true); |
406 } | 406 } |
407 | 407 |
408 TileManager* tile_manager() { return host_impl_.tile_manager(); } | 408 TileManager* tile_manager() { return host_impl_.tile_manager(); } |
409 | 409 |
410 protected: | 410 protected: |
411 GlobalStateThatImpactsTilePriority global_state_; | 411 GlobalStateThatImpactsTilePriority global_state_; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); | 476 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); |
477 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); | 477 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); |
478 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); | 478 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); |
479 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); | 479 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); |
480 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); | 480 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); |
481 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); | 481 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); |
482 } | 482 } |
483 | 483 |
484 } // namespace | 484 } // namespace |
485 } // namespace cc | 485 } // namespace cc |
OLD | NEW |