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 "cc/raster/tile_task_worker_pool.h" | 5 #include "cc/raster/tile_task_worker_pool.h" |
6 | 6 |
7 #include "base/test/test_simple_task_runner.h" | 7 #include "base/test/test_simple_task_runner.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "cc/debug/lap_timer.h" | 9 #include "cc/debug/lap_timer.h" |
10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 std::numeric_limits<size_t>::max()); | 258 std::numeric_limits<size_t>::max()); |
259 break; | 259 break; |
260 case TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY: | 260 case TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY: |
261 Create3dOutputSurfaceAndResourceProvider(); | 261 Create3dOutputSurfaceAndResourceProvider(); |
262 tile_task_worker_pool_ = ZeroCopyTileTaskWorkerPool::Create( | 262 tile_task_worker_pool_ = ZeroCopyTileTaskWorkerPool::Create( |
263 task_runner_.get(), task_graph_runner_.get(), | 263 task_runner_.get(), task_graph_runner_.get(), |
264 resource_provider_.get()); | 264 resource_provider_.get()); |
265 break; | 265 break; |
266 case TILE_TASK_WORKER_POOL_TYPE_ONE_COPY: | 266 case TILE_TASK_WORKER_POOL_TYPE_ONE_COPY: |
267 Create3dOutputSurfaceAndResourceProvider(); | 267 Create3dOutputSurfaceAndResourceProvider(); |
268 staging_resource_pool_ = ResourcePool::Create(resource_provider_.get(), | |
269 GL_TEXTURE_2D); | |
270 tile_task_worker_pool_ = OneCopyTileTaskWorkerPool::Create( | 268 tile_task_worker_pool_ = OneCopyTileTaskWorkerPool::Create( |
271 task_runner_.get(), task_graph_runner_.get(), | 269 task_runner_.get(), task_graph_runner_.get(), |
272 context_provider_.get(), resource_provider_.get(), | 270 context_provider_.get(), resource_provider_.get(), |
273 staging_resource_pool_.get(), std::numeric_limits<int>::max(), | 271 std::numeric_limits<int>::max(), false, |
274 false); | 272 std::numeric_limits<int>::max()); |
275 break; | 273 break; |
276 case TILE_TASK_WORKER_POOL_TYPE_GPU: | 274 case TILE_TASK_WORKER_POOL_TYPE_GPU: |
277 Create3dOutputSurfaceAndResourceProvider(); | 275 Create3dOutputSurfaceAndResourceProvider(); |
278 tile_task_worker_pool_ = GpuTileTaskWorkerPool::Create( | 276 tile_task_worker_pool_ = GpuTileTaskWorkerPool::Create( |
279 task_runner_.get(), task_graph_runner_.get(), | 277 task_runner_.get(), task_graph_runner_.get(), |
280 context_provider_.get(), resource_provider_.get(), false, 0); | 278 context_provider_.get(), resource_provider_.get(), false, 0); |
281 break; | 279 break; |
282 case TILE_TASK_WORKER_POOL_TYPE_BITMAP: | 280 case TILE_TASK_WORKER_POOL_TYPE_BITMAP: |
283 CreateSoftwareOutputSurfaceAndResourceProvider(); | 281 CreateSoftwareOutputSurfaceAndResourceProvider(); |
284 tile_task_worker_pool_ = BitmapTileTaskWorkerPool::Create( | 282 tile_task_worker_pool_ = BitmapTileTaskWorkerPool::Create( |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 return std::string("_one_copy_tile_task_worker_pool"); | 422 return std::string("_one_copy_tile_task_worker_pool"); |
425 case TILE_TASK_WORKER_POOL_TYPE_GPU: | 423 case TILE_TASK_WORKER_POOL_TYPE_GPU: |
426 return std::string("_gpu_tile_task_worker_pool"); | 424 return std::string("_gpu_tile_task_worker_pool"); |
427 case TILE_TASK_WORKER_POOL_TYPE_BITMAP: | 425 case TILE_TASK_WORKER_POOL_TYPE_BITMAP: |
428 return std::string("_bitmap_tile_task_worker_pool"); | 426 return std::string("_bitmap_tile_task_worker_pool"); |
429 } | 427 } |
430 NOTREACHED(); | 428 NOTREACHED(); |
431 return std::string(); | 429 return std::string(); |
432 } | 430 } |
433 | 431 |
434 scoped_ptr<ResourcePool> staging_resource_pool_; | |
435 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; | 432 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; |
436 TestGpuMemoryBufferManager gpu_memory_buffer_manager_; | 433 TestGpuMemoryBufferManager gpu_memory_buffer_manager_; |
437 TestSharedBitmapManager shared_bitmap_manager_; | 434 TestSharedBitmapManager shared_bitmap_manager_; |
438 }; | 435 }; |
439 | 436 |
440 TEST_P(TileTaskWorkerPoolPerfTest, ScheduleTasks) { | 437 TEST_P(TileTaskWorkerPoolPerfTest, ScheduleTasks) { |
441 RunScheduleTasksTest("1_0", 1, 0); | 438 RunScheduleTasksTest("1_0", 1, 0); |
442 RunScheduleTasksTest("32_0", 32, 0); | 439 RunScheduleTasksTest("32_0", 32, 0); |
443 RunScheduleTasksTest("1_1", 1, 1); | 440 RunScheduleTasksTest("1_1", 1, 1); |
444 RunScheduleTasksTest("32_1", 32, 1); | 441 RunScheduleTasksTest("32_1", 32, 1); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 RunBuildTileTaskQueueTest("1_0", 1, 0); | 508 RunBuildTileTaskQueueTest("1_0", 1, 0); |
512 RunBuildTileTaskQueueTest("32_0", 32, 0); | 509 RunBuildTileTaskQueueTest("32_0", 32, 0); |
513 RunBuildTileTaskQueueTest("1_1", 1, 1); | 510 RunBuildTileTaskQueueTest("1_1", 1, 1); |
514 RunBuildTileTaskQueueTest("32_1", 32, 1); | 511 RunBuildTileTaskQueueTest("32_1", 32, 1); |
515 RunBuildTileTaskQueueTest("1_4", 1, 4); | 512 RunBuildTileTaskQueueTest("1_4", 1, 4); |
516 RunBuildTileTaskQueueTest("32_4", 32, 4); | 513 RunBuildTileTaskQueueTest("32_4", 32, 4); |
517 } | 514 } |
518 | 515 |
519 } // namespace | 516 } // namespace |
520 } // namespace cc | 517 } // namespace cc |
OLD | NEW |