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 <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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 ASSERT_FALSE(timed_out_) << "Test timed out"; | 197 ASSERT_FALSE(timed_out_) << "Test timed out"; |
198 } | 198 } |
199 | 199 |
200 void ScheduleTasks() { | 200 void ScheduleTasks() { |
201 RasterTaskQueue queue; | 201 RasterTaskQueue queue; |
202 | 202 |
203 for (RasterTaskVector::const_iterator it = tasks_.begin(); | 203 for (RasterTaskVector::const_iterator it = tasks_.begin(); |
204 it != tasks_.end(); | 204 it != tasks_.end(); |
205 ++it) | 205 ++it) |
206 queue.items.push_back(RasterTaskQueue::Item(*it, false)); | 206 queue.items.push_back(RasterTaskQueue::Item(it->get(), false)); |
207 | 207 |
208 raster_worker_pool_->AsRasterizer()->ScheduleTasks(&queue); | 208 raster_worker_pool_->AsRasterizer()->ScheduleTasks(&queue); |
209 } | 209 } |
210 | 210 |
211 void AppendTask(unsigned id, const gfx::Size& size) { | 211 void AppendTask(unsigned id, const gfx::Size& size) { |
212 scoped_ptr<ScopedResource> resource( | 212 scoped_ptr<ScopedResource> resource( |
213 ScopedResource::Create(resource_provider_.get())); | 213 ScopedResource::Create(resource_provider_.get())); |
214 resource->Allocate(size, ResourceProvider::TextureHintImmutable, RGBA_8888); | 214 resource->Allocate(size, ResourceProvider::TextureHintImmutable, RGBA_8888); |
215 const Resource* const_resource = resource.get(); | 215 const Resource* const_resource = resource.get(); |
216 | 216 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 INSTANTIATE_TEST_CASE_P(RasterWorkerPoolTests, | 353 INSTANTIATE_TEST_CASE_P(RasterWorkerPoolTests, |
354 RasterWorkerPoolTest, | 354 RasterWorkerPoolTest, |
355 ::testing::Values(RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER, | 355 ::testing::Values(RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER, |
356 RASTER_WORKER_POOL_TYPE_IMAGE, | 356 RASTER_WORKER_POOL_TYPE_IMAGE, |
357 RASTER_WORKER_POOL_TYPE_IMAGE_COPY, | 357 RASTER_WORKER_POOL_TYPE_IMAGE_COPY, |
358 RASTER_WORKER_POOL_TYPE_GPU)); | 358 RASTER_WORKER_POOL_TYPE_GPU)); |
359 | 359 |
360 } // namespace | 360 } // namespace |
361 } // namespace cc | 361 } // namespace cc |
OLD | NEW |