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

Side by Side Diff: cc/resources/raster_worker_pool_unittest.cc

Issue 486853002: cc: Use a normal texture for background texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits in unittests Created 6 years, 4 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
« no previous file with comments | « cc/resources/raster_worker_pool_perftest.cc ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « cc/resources/raster_worker_pool_perftest.cc ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698