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/resources/raster_worker_pool.h" | 5 #include "cc/resources/raster_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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 task_graph_runner_.get(), | 255 task_graph_runner_.get(), |
256 context_provider_.get(), | 256 context_provider_.get(), |
257 resource_provider_.get(), | 257 resource_provider_.get(), |
258 staging_resource_pool_.get()); | 258 staging_resource_pool_.get()); |
259 break; | 259 break; |
260 case RASTER_WORKER_POOL_TYPE_GPU: | 260 case RASTER_WORKER_POOL_TYPE_GPU: |
261 Create3dOutputSurfaceAndResourceProvider(); | 261 Create3dOutputSurfaceAndResourceProvider(); |
262 raster_worker_pool_ = | 262 raster_worker_pool_ = |
263 GpuRasterWorkerPool::Create(task_runner_.get(), | 263 GpuRasterWorkerPool::Create(task_runner_.get(), |
264 context_provider_.get(), | 264 context_provider_.get(), |
265 resource_provider_.get()); | 265 resource_provider_.get(), |
| 266 false); |
266 break; | 267 break; |
267 case RASTER_WORKER_POOL_TYPE_BITMAP: | 268 case RASTER_WORKER_POOL_TYPE_BITMAP: |
268 CreateSoftwareOutputSurfaceAndResourceProvider(); | 269 CreateSoftwareOutputSurfaceAndResourceProvider(); |
269 raster_worker_pool_ = | 270 raster_worker_pool_ = |
270 BitmapRasterWorkerPool::Create(task_runner_.get(), | 271 BitmapRasterWorkerPool::Create(task_runner_.get(), |
271 task_graph_runner_.get(), | 272 task_graph_runner_.get(), |
272 resource_provider_.get()); | 273 resource_provider_.get()); |
273 break; | 274 break; |
274 } | 275 } |
275 | 276 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 private: | 400 private: |
400 void Create3dOutputSurfaceAndResourceProvider() { | 401 void Create3dOutputSurfaceAndResourceProvider() { |
401 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); | 402 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); |
402 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 403 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
403 resource_provider_ = ResourceProvider::Create(output_surface_.get(), | 404 resource_provider_ = ResourceProvider::Create(output_surface_.get(), |
404 NULL, | 405 NULL, |
405 &gpu_memory_buffer_manager_, | 406 &gpu_memory_buffer_manager_, |
406 NULL, | 407 NULL, |
407 0, | 408 0, |
408 false, | 409 false, |
409 1, | 410 1).Pass(); |
410 false).Pass(); | |
411 } | 411 } |
412 | 412 |
413 void CreateSoftwareOutputSurfaceAndResourceProvider() { | 413 void CreateSoftwareOutputSurfaceAndResourceProvider() { |
414 output_surface_ = FakeOutputSurface::CreateSoftware( | 414 output_surface_ = FakeOutputSurface::CreateSoftware( |
415 make_scoped_ptr(new SoftwareOutputDevice)); | 415 make_scoped_ptr(new SoftwareOutputDevice)); |
416 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 416 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
417 resource_provider_ = ResourceProvider::Create(output_surface_.get(), | 417 resource_provider_ = ResourceProvider::Create(output_surface_.get(), |
418 &shared_bitmap_manager_, | 418 &shared_bitmap_manager_, |
419 NULL, | 419 NULL, |
420 NULL, | 420 NULL, |
421 0, | 421 0, |
422 false, | 422 false, |
423 1, | 423 1).Pass(); |
424 false).Pass(); | |
425 } | 424 } |
426 | 425 |
427 std::string TestModifierString() const { | 426 std::string TestModifierString() const { |
428 switch (GetParam()) { | 427 switch (GetParam()) { |
429 case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER: | 428 case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER: |
430 return std::string("_pixel_raster_worker_pool"); | 429 return std::string("_pixel_raster_worker_pool"); |
431 case RASTER_WORKER_POOL_TYPE_ZERO_COPY: | 430 case RASTER_WORKER_POOL_TYPE_ZERO_COPY: |
432 return std::string("_zero_copy_raster_worker_pool"); | 431 return std::string("_zero_copy_raster_worker_pool"); |
433 case RASTER_WORKER_POOL_TYPE_ONE_COPY: | 432 case RASTER_WORKER_POOL_TYPE_ONE_COPY: |
434 return std::string("_one_copy_raster_worker_pool"); | 433 return std::string("_one_copy_raster_worker_pool"); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 | 483 |
485 class RasterWorkerPoolCommonPerfTest : public RasterWorkerPoolPerfTestBase, | 484 class RasterWorkerPoolCommonPerfTest : public RasterWorkerPoolPerfTestBase, |
486 public testing::Test { | 485 public testing::Test { |
487 public: | 486 public: |
488 // Overridden from testing::Test: | 487 // Overridden from testing::Test: |
489 virtual void SetUp() override { | 488 virtual void SetUp() override { |
490 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); | 489 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); |
491 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 490 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
492 resource_provider_ = | 491 resource_provider_ = |
493 ResourceProvider::Create( | 492 ResourceProvider::Create( |
494 output_surface_.get(), NULL, NULL, NULL, 0, false, 1, false).Pass(); | 493 output_surface_.get(), NULL, NULL, NULL, 0, false, 1).Pass(); |
495 } | 494 } |
496 | 495 |
497 void RunBuildRasterTaskQueueTest(const std::string& test_name, | 496 void RunBuildRasterTaskQueueTest(const std::string& test_name, |
498 unsigned num_raster_tasks, | 497 unsigned num_raster_tasks, |
499 unsigned num_image_decode_tasks) { | 498 unsigned num_image_decode_tasks) { |
500 ImageDecodeTask::Vector image_decode_tasks; | 499 ImageDecodeTask::Vector image_decode_tasks; |
501 RasterTaskVector raster_tasks; | 500 RasterTaskVector raster_tasks; |
502 CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks); | 501 CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks); |
503 CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks); | 502 CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks); |
504 | 503 |
(...skipping 20 matching lines...) Expand all Loading... |
525 RunBuildRasterTaskQueueTest("1_0", 1, 0); | 524 RunBuildRasterTaskQueueTest("1_0", 1, 0); |
526 RunBuildRasterTaskQueueTest("32_0", 32, 0); | 525 RunBuildRasterTaskQueueTest("32_0", 32, 0); |
527 RunBuildRasterTaskQueueTest("1_1", 1, 1); | 526 RunBuildRasterTaskQueueTest("1_1", 1, 1); |
528 RunBuildRasterTaskQueueTest("32_1", 32, 1); | 527 RunBuildRasterTaskQueueTest("32_1", 32, 1); |
529 RunBuildRasterTaskQueueTest("1_4", 1, 4); | 528 RunBuildRasterTaskQueueTest("1_4", 1, 4); |
530 RunBuildRasterTaskQueueTest("32_4", 32, 4); | 529 RunBuildRasterTaskQueueTest("32_4", 32, 4); |
531 } | 530 } |
532 | 531 |
533 } // namespace | 532 } // namespace |
534 } // namespace cc | 533 } // namespace cc |
OLD | NEW |