| 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/tile_task_worker_pool.h" | 5 #include "cc/resources/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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 const std::vector<RasterTaskResult>& completed_tasks() const { | 268 const std::vector<RasterTaskResult>& completed_tasks() const { |
| 269 return completed_tasks_; | 269 return completed_tasks_; |
| 270 } | 270 } |
| 271 | 271 |
| 272 private: | 272 private: |
| 273 void Create3dOutputSurfaceAndResourceProvider() { | 273 void Create3dOutputSurfaceAndResourceProvider() { |
| 274 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); | 274 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); |
| 275 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 275 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 276 TestWebGraphicsContext3D* context3d = context_provider_->TestContext3d(); | 276 TestWebGraphicsContext3D* context3d = context_provider_->TestContext3d(); |
| 277 context3d->set_support_sync_query(true); | 277 context3d->set_support_sync_query(true); |
| 278 resource_provider_ = ResourceProvider::Create(output_surface_.get(), NULL, | 278 resource_provider_ = |
| 279 &gpu_memory_buffer_manager_, | 279 ResourceProvider::Create(output_surface_.get(), NULL, |
| 280 NULL, 0, false, 1).Pass(); | 280 &gpu_memory_buffer_manager_, NULL, 0, false, |
| 281 false, 1).Pass(); |
| 281 } | 282 } |
| 282 | 283 |
| 283 void CreateSoftwareOutputSurfaceAndResourceProvider() { | 284 void CreateSoftwareOutputSurfaceAndResourceProvider() { |
| 284 output_surface_ = FakeOutputSurface::CreateSoftware( | 285 output_surface_ = FakeOutputSurface::CreateSoftware( |
| 285 make_scoped_ptr(new SoftwareOutputDevice)); | 286 make_scoped_ptr(new SoftwareOutputDevice)); |
| 286 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 287 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 287 resource_provider_ = | 288 resource_provider_ = |
| 288 ResourceProvider::Create(output_surface_.get(), &shared_bitmap_manager_, | 289 ResourceProvider::Create(output_surface_.get(), &shared_bitmap_manager_, |
| 289 NULL, NULL, 0, false, 1).Pass(); | 290 NULL, NULL, 0, false, false, 1).Pass(); |
| 290 } | 291 } |
| 291 | 292 |
| 292 void OnTaskCompleted(scoped_ptr<ScopedResource> resource, | 293 void OnTaskCompleted(scoped_ptr<ScopedResource> resource, |
| 293 unsigned id, | 294 unsigned id, |
| 294 const RasterSource::SolidColorAnalysis& analysis, | 295 const RasterSource::SolidColorAnalysis& analysis, |
| 295 bool was_canceled) { | 296 bool was_canceled) { |
| 296 RasterTaskResult result; | 297 RasterTaskResult result; |
| 297 result.id = id; | 298 result.id = id; |
| 298 result.canceled = was_canceled; | 299 result.canceled = was_canceled; |
| 299 completed_tasks_.push_back(result); | 300 completed_tasks_.push_back(result); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 TileTaskWorkerPoolTests, | 399 TileTaskWorkerPoolTests, |
| 399 TileTaskWorkerPoolTest, | 400 TileTaskWorkerPoolTest, |
| 400 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_PIXEL_BUFFER, | 401 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_PIXEL_BUFFER, |
| 401 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, | 402 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, |
| 402 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, | 403 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, |
| 403 TILE_TASK_WORKER_POOL_TYPE_GPU, | 404 TILE_TASK_WORKER_POOL_TYPE_GPU, |
| 404 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); | 405 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); |
| 405 | 406 |
| 406 } // namespace | 407 } // namespace |
| 407 } // namespace cc | 408 } // namespace cc |
| OLD | NEW |