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