| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 timeout_seconds_(5), | 140 timeout_seconds_(5), |
| 141 timed_out_(false) {} | 141 timed_out_(false) {} |
| 142 | 142 |
| 143 // Overridden from testing::Test: | 143 // Overridden from testing::Test: |
| 144 void SetUp() override { | 144 void SetUp() override { |
| 145 switch (GetParam()) { | 145 switch (GetParam()) { |
| 146 case TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY: | 146 case TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY: |
| 147 Create3dOutputSurfaceAndResourceProvider(); | 147 Create3dOutputSurfaceAndResourceProvider(); |
| 148 tile_task_worker_pool_ = ZeroCopyTileTaskWorkerPool::Create( | 148 tile_task_worker_pool_ = ZeroCopyTileTaskWorkerPool::Create( |
| 149 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, | 149 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, |
| 150 resource_provider_.get(), false); | 150 resource_provider_.get(), PlatformColor::BestTextureFormat()); |
| 151 break; | 151 break; |
| 152 case TILE_TASK_WORKER_POOL_TYPE_ONE_COPY: | 152 case TILE_TASK_WORKER_POOL_TYPE_ONE_COPY: |
| 153 Create3dOutputSurfaceAndResourceProvider(); | 153 Create3dOutputSurfaceAndResourceProvider(); |
| 154 tile_task_worker_pool_ = OneCopyTileTaskWorkerPool::Create( | 154 tile_task_worker_pool_ = OneCopyTileTaskWorkerPool::Create( |
| 155 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, | 155 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, |
| 156 context_provider_.get(), resource_provider_.get(), | 156 context_provider_.get(), resource_provider_.get(), |
| 157 kMaxBytesPerCopyOperation, false, kMaxStagingBuffers, false); | 157 kMaxBytesPerCopyOperation, false, kMaxStagingBuffers, |
| 158 PlatformColor::BestTextureFormat()); |
| 158 break; | 159 break; |
| 159 case TILE_TASK_WORKER_POOL_TYPE_GPU: | 160 case TILE_TASK_WORKER_POOL_TYPE_GPU: |
| 160 Create3dOutputSurfaceAndResourceProvider(); | 161 Create3dOutputSurfaceAndResourceProvider(); |
| 161 tile_task_worker_pool_ = GpuTileTaskWorkerPool::Create( | 162 tile_task_worker_pool_ = GpuTileTaskWorkerPool::Create( |
| 162 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, | 163 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, |
| 163 context_provider_.get(), resource_provider_.get(), false, 0); | 164 context_provider_.get(), resource_provider_.get(), false, 0); |
| 164 break; | 165 break; |
| 165 case TILE_TASK_WORKER_POOL_TYPE_BITMAP: | 166 case TILE_TASK_WORKER_POOL_TYPE_BITMAP: |
| 166 CreateSoftwareOutputSurfaceAndResourceProvider(); | 167 CreateSoftwareOutputSurfaceAndResourceProvider(); |
| 167 tile_task_worker_pool_ = BitmapTileTaskWorkerPool::Create( | 168 tile_task_worker_pool_ = BitmapTileTaskWorkerPool::Create( |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 370 |
| 370 INSTANTIATE_TEST_CASE_P(TileTaskWorkerPoolTests, | 371 INSTANTIATE_TEST_CASE_P(TileTaskWorkerPoolTests, |
| 371 TileTaskWorkerPoolTest, | 372 TileTaskWorkerPoolTest, |
| 372 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, | 373 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, |
| 373 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, | 374 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, |
| 374 TILE_TASK_WORKER_POOL_TYPE_GPU, | 375 TILE_TASK_WORKER_POOL_TYPE_GPU, |
| 375 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); | 376 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); |
| 376 | 377 |
| 377 } // namespace | 378 } // namespace |
| 378 } // namespace cc | 379 } // namespace cc |
| OLD | NEW |