Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: cc/raster/tile_task_worker_pool_unittest.cc

Issue 1230203007: Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add ContextProvider::ScopedContextGL class Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 kMaxTransferBufferUsageBytes); 158 kMaxTransferBufferUsageBytes);
159 break; 159 break;
160 case TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY: 160 case TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY:
161 Create3dOutputSurfaceAndResourceProvider(); 161 Create3dOutputSurfaceAndResourceProvider();
162 tile_task_worker_pool_ = ZeroCopyTileTaskWorkerPool::Create( 162 tile_task_worker_pool_ = ZeroCopyTileTaskWorkerPool::Create(
163 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, 163 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_,
164 resource_provider_.get()); 164 resource_provider_.get());
165 break; 165 break;
166 case TILE_TASK_WORKER_POOL_TYPE_ONE_COPY: 166 case TILE_TASK_WORKER_POOL_TYPE_ONE_COPY:
167 Create3dOutputSurfaceAndResourceProvider(); 167 Create3dOutputSurfaceAndResourceProvider();
168 staging_resource_pool_ = ResourcePool::Create(resource_provider_.get(),
169 GL_TEXTURE_2D);
170 tile_task_worker_pool_ = OneCopyTileTaskWorkerPool::Create( 168 tile_task_worker_pool_ = OneCopyTileTaskWorkerPool::Create(
171 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, 169 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_,
172 context_provider_.get(), resource_provider_.get(), 170 context_provider_.get(), resource_provider_.get(),
173 staging_resource_pool_.get(), kMaxBytesPerCopyOperation, false); 171 kMaxBytesPerCopyOperation, false, GL_TEXTURE_2D);
174 break; 172 break;
175 case TILE_TASK_WORKER_POOL_TYPE_GPU: 173 case TILE_TASK_WORKER_POOL_TYPE_GPU:
176 Create3dOutputSurfaceAndResourceProvider(); 174 Create3dOutputSurfaceAndResourceProvider();
177 tile_task_worker_pool_ = GpuTileTaskWorkerPool::Create( 175 tile_task_worker_pool_ = GpuTileTaskWorkerPool::Create(
178 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_, 176 base::ThreadTaskRunnerHandle::Get().get(), &task_graph_runner_,
179 context_provider_.get(), resource_provider_.get(), false, 0); 177 context_provider_.get(), resource_provider_.get(), false, 0);
180 break; 178 break;
181 case TILE_TASK_WORKER_POOL_TYPE_BITMAP: 179 case TILE_TASK_WORKER_POOL_TYPE_BITMAP:
182 CreateSoftwareOutputSurfaceAndResourceProvider(); 180 CreateSoftwareOutputSurfaceAndResourceProvider();
183 tile_task_worker_pool_ = BitmapTileTaskWorkerPool::Create( 181 tile_task_worker_pool_ = BitmapTileTaskWorkerPool::Create(
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 timed_out_ = true; 323 timed_out_ = true;
326 base::MessageLoop::current()->Quit(); 324 base::MessageLoop::current()->Quit();
327 } 325 }
328 326
329 protected: 327 protected:
330 scoped_refptr<TestContextProvider> context_provider_; 328 scoped_refptr<TestContextProvider> context_provider_;
331 scoped_refptr<TestContextProvider> worker_context_provider_; 329 scoped_refptr<TestContextProvider> worker_context_provider_;
332 FakeOutputSurfaceClient output_surface_client_; 330 FakeOutputSurfaceClient output_surface_client_;
333 scoped_ptr<FakeOutputSurface> output_surface_; 331 scoped_ptr<FakeOutputSurface> output_surface_;
334 scoped_ptr<ResourceProvider> resource_provider_; 332 scoped_ptr<ResourceProvider> resource_provider_;
335 scoped_ptr<ResourcePool> staging_resource_pool_;
336 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; 333 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_;
337 TestGpuMemoryBufferManager gpu_memory_buffer_manager_; 334 TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
338 TestSharedBitmapManager shared_bitmap_manager_; 335 TestSharedBitmapManager shared_bitmap_manager_;
339 TestTaskGraphRunner task_graph_runner_; 336 TestTaskGraphRunner task_graph_runner_;
340 base::CancelableClosure timeout_; 337 base::CancelableClosure timeout_;
341 UniqueNotifier all_tile_tasks_finished_; 338 UniqueNotifier all_tile_tasks_finished_;
342 int timeout_seconds_; 339 int timeout_seconds_;
343 bool timed_out_; 340 bool timed_out_;
344 RasterTaskVector tasks_; 341 RasterTaskVector tasks_;
345 std::vector<RasterTaskResult> completed_tasks_; 342 std::vector<RasterTaskResult> completed_tasks_;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 TileTaskWorkerPoolTests, 452 TileTaskWorkerPoolTests,
456 TileTaskWorkerPoolTest, 453 TileTaskWorkerPoolTest,
457 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_PIXEL_BUFFER, 454 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_PIXEL_BUFFER,
458 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, 455 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY,
459 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, 456 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY,
460 TILE_TASK_WORKER_POOL_TYPE_GPU, 457 TILE_TASK_WORKER_POOL_TYPE_GPU,
461 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); 458 TILE_TASK_WORKER_POOL_TYPE_BITMAP));
462 459
463 } // namespace 460 } // namespace
464 } // namespace cc 461 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698