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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 queue.items.push_back(RasterTaskQueue::Item(*it, false)); | 201 queue.items.push_back(RasterTaskQueue::Item(*it, false)); |
202 | 202 |
203 raster_worker_pool_->AsRasterizer()->ScheduleTasks(&queue); | 203 raster_worker_pool_->AsRasterizer()->ScheduleTasks(&queue); |
204 } | 204 } |
205 | 205 |
206 void AppendTask(unsigned id) { | 206 void AppendTask(unsigned id) { |
207 const gfx::Size size(1, 1); | 207 const gfx::Size size(1, 1); |
208 | 208 |
209 scoped_ptr<ScopedResource> resource( | 209 scoped_ptr<ScopedResource> resource( |
210 ScopedResource::Create(resource_provider_.get())); | 210 ScopedResource::Create(resource_provider_.get())); |
211 resource->Allocate(size, ResourceProvider::TextureUsageAny, RGBA_8888); | 211 resource->Allocate(size, ResourceProvider::TextureHintImmutable, RGBA_8888); |
212 const Resource* const_resource = resource.get(); | 212 const Resource* const_resource = resource.get(); |
213 | 213 |
214 ImageDecodeTask::Vector empty; | 214 ImageDecodeTask::Vector empty; |
215 tasks_.push_back(new TestRasterTaskImpl( | 215 tasks_.push_back(new TestRasterTaskImpl( |
216 const_resource, | 216 const_resource, |
217 base::Bind(&RasterWorkerPoolTest::OnTaskCompleted, | 217 base::Bind(&RasterWorkerPoolTest::OnTaskCompleted, |
218 base::Unretained(this), | 218 base::Unretained(this), |
219 base::Passed(&resource), | 219 base::Passed(&resource), |
220 id), | 220 id), |
221 &empty)); | 221 &empty)); |
222 } | 222 } |
223 | 223 |
224 void AppendBlockingTask(unsigned id, base::Lock* lock) { | 224 void AppendBlockingTask(unsigned id, base::Lock* lock) { |
225 const gfx::Size size(1, 1); | 225 const gfx::Size size(1, 1); |
226 | 226 |
227 scoped_ptr<ScopedResource> resource( | 227 scoped_ptr<ScopedResource> resource( |
228 ScopedResource::Create(resource_provider_.get())); | 228 ScopedResource::Create(resource_provider_.get())); |
229 resource->Allocate(size, ResourceProvider::TextureUsageAny, RGBA_8888); | 229 resource->Allocate(size, ResourceProvider::TextureHintImmutable, RGBA_8888); |
230 const Resource* const_resource = resource.get(); | 230 const Resource* const_resource = resource.get(); |
231 | 231 |
232 ImageDecodeTask::Vector empty; | 232 ImageDecodeTask::Vector empty; |
233 tasks_.push_back(new BlockingTestRasterTaskImpl( | 233 tasks_.push_back(new BlockingTestRasterTaskImpl( |
234 const_resource, | 234 const_resource, |
235 base::Bind(&RasterWorkerPoolTest::OnTaskCompleted, | 235 base::Bind(&RasterWorkerPoolTest::OnTaskCompleted, |
236 base::Unretained(this), | 236 base::Unretained(this), |
237 base::Passed(&resource), | 237 base::Passed(&resource), |
238 id), | 238 id), |
239 lock, | 239 lock, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 INSTANTIATE_TEST_CASE_P(RasterWorkerPoolTests, | 327 INSTANTIATE_TEST_CASE_P(RasterWorkerPoolTests, |
328 RasterWorkerPoolTest, | 328 RasterWorkerPoolTest, |
329 ::testing::Values(RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER, | 329 ::testing::Values(RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER, |
330 RASTER_WORKER_POOL_TYPE_IMAGE, | 330 RASTER_WORKER_POOL_TYPE_IMAGE, |
331 RASTER_WORKER_POOL_TYPE_IMAGE_COPY, | 331 RASTER_WORKER_POOL_TYPE_IMAGE_COPY, |
332 RASTER_WORKER_POOL_TYPE_GPU)); | 332 RASTER_WORKER_POOL_TYPE_GPU)); |
333 | 333 |
334 } // namespace | 334 } // namespace |
335 } // namespace cc | 335 } // namespace cc |
OLD | NEW |