| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 for (const auto& layer : layers) { | 242 for (const auto& layer : layers) { |
| 243 layer->UpdateTiles(Occlusion(), resourceless_software_draw); | 243 layer->UpdateTiles(Occlusion(), resourceless_software_draw); |
| 244 for (size_t i = 0; i < layer->num_tilings(); ++i) { | 244 for (size_t i = 0; i < layer->num_tilings(); ++i) { |
| 245 tile_manager()->InitializeTilesWithResourcesForTesting( | 245 tile_manager()->InitializeTilesWithResourcesForTesting( |
| 246 layer->tilings()->tiling_at(i)->AllTilesForTesting()); | 246 layer->tilings()->tiling_at(i)->AllTilesForTesting()); |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 | 249 |
| 250 timer_.Reset(); | 250 timer_.Reset(); |
| 251 do { | 251 do { |
| 252 EvictionTilePriorityQueue queue; | 252 scoped_ptr<EvictionTilePriorityQueue> queue( |
| 253 host_impl_.BuildEvictionQueue(&queue, priorities[priority_count]); | 253 host_impl_.BuildEvictionQueue(priorities[priority_count])); |
| 254 priority_count = (priority_count + 1) % arraysize(priorities); | 254 priority_count = (priority_count + 1) % arraysize(priorities); |
| 255 timer_.NextLap(); | 255 timer_.NextLap(); |
| 256 } while (!timer_.HasTimeLimitExpired()); | 256 } while (!timer_.HasTimeLimitExpired()); |
| 257 | 257 |
| 258 perf_test::PrintResult("tile_manager_eviction_tile_queue_construct", | 258 perf_test::PrintResult("tile_manager_eviction_tile_queue_construct", |
| 259 "", | 259 "", |
| 260 test_name, | 260 test_name, |
| 261 timer_.LapsPerSecond(), | 261 timer_.LapsPerSecond(), |
| 262 "runs/s", | 262 "runs/s", |
| 263 true); | 263 true); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 278 layer->UpdateTiles(Occlusion(), resourceless_software_draw); | 278 layer->UpdateTiles(Occlusion(), resourceless_software_draw); |
| 279 for (size_t i = 0; i < layer->num_tilings(); ++i) { | 279 for (size_t i = 0; i < layer->num_tilings(); ++i) { |
| 280 tile_manager()->InitializeTilesWithResourcesForTesting( | 280 tile_manager()->InitializeTilesWithResourcesForTesting( |
| 281 layer->tilings()->tiling_at(i)->AllTilesForTesting()); | 281 layer->tilings()->tiling_at(i)->AllTilesForTesting()); |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 | 284 |
| 285 timer_.Reset(); | 285 timer_.Reset(); |
| 286 do { | 286 do { |
| 287 int count = tile_count; | 287 int count = tile_count; |
| 288 EvictionTilePriorityQueue queue; | 288 scoped_ptr<EvictionTilePriorityQueue> queue( |
| 289 host_impl_.BuildEvictionQueue(&queue, priorities[priority_count]); | 289 host_impl_.BuildEvictionQueue(priorities[priority_count])); |
| 290 while (count--) { | 290 while (count--) { |
| 291 ASSERT_FALSE(queue.IsEmpty()); | 291 ASSERT_FALSE(queue->IsEmpty()); |
| 292 ASSERT_TRUE(queue.Top() != NULL); | 292 ASSERT_TRUE(queue->Top() != NULL); |
| 293 queue.Pop(); | 293 queue->Pop(); |
| 294 } | 294 } |
| 295 priority_count = (priority_count + 1) % arraysize(priorities); | 295 priority_count = (priority_count + 1) % arraysize(priorities); |
| 296 timer_.NextLap(); | 296 timer_.NextLap(); |
| 297 } while (!timer_.HasTimeLimitExpired()); | 297 } while (!timer_.HasTimeLimitExpired()); |
| 298 | 298 |
| 299 perf_test::PrintResult( | 299 perf_test::PrintResult( |
| 300 "tile_manager_eviction_tile_queue_construct_and_iterate", | 300 "tile_manager_eviction_tile_queue_construct_and_iterate", |
| 301 "", | 301 "", |
| 302 test_name, | 302 test_name, |
| 303 timer_.LapsPerSecond(), | 303 timer_.LapsPerSecond(), |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); | 467 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); |
| 468 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); | 468 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); |
| 469 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); | 469 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); |
| 470 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); | 470 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); |
| 471 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); | 471 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); |
| 472 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); | 472 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace | 475 } // namespace |
| 476 } // namespace cc | 476 } // namespace cc |
| OLD | NEW |