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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 862933005: remove drawtype (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 // This is a GPU-backend specific test. It relies on static intializers to work 9 // This is a GPU-backend specific test. It relies on static intializers to work
10 10
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 SkDebugf("Could not allocate render target"); 265 SkDebugf("Could not allocate render target");
266 return false; 266 return false;
267 } 267 }
268 268
269 GrDrawState ds; 269 GrDrawState ds;
270 ds.setRenderTarget(rt.get()); 270 ds.setRenderTarget(rt.get());
271 271
272 // if path rendering we have to setup a couple of things like the draw t ype 272 // if path rendering we have to setup a couple of things like the draw t ype
273 bool usePathRendering = gpu->glCaps().pathRenderingSupport() && random.n extBool(); 273 bool usePathRendering = gpu->glCaps().pathRenderingSupport() && random.n extBool();
274 274
275 GrGpu::DrawType drawType = usePathRendering ? GrGpu::kDrawPath_DrawType :
276 GrGpu::kDrawPoints_DrawTyp e;
277
278 // twiddle drawstate knobs randomly 275 // twiddle drawstate knobs randomly
279 bool hasGeometryProcessor = !usePathRendering; 276 bool hasGeometryProcessor = !usePathRendering;
280 SkAutoTUnref<const GrGeometryProcessor> gp; 277 SkAutoTUnref<const GrGeometryProcessor> gp;
281 SkAutoTUnref<const GrPathProcessor> pathProc; 278 SkAutoTUnref<const GrPathProcessor> pathProc;
282 if (hasGeometryProcessor) { 279 if (hasGeometryProcessor) {
283 gp.reset(get_random_gp(fContext, gpu->glCaps(), &random, dummyTextur es)); 280 gp.reset(get_random_gp(fContext, gpu->glCaps(), &random, dummyTextur es));
284 } else { 281 } else {
285 pathProc.reset(GrPathProcessor::Create(GrColor_WHITE)); 282 pathProc.reset(GrPathProcessor::Create(GrColor_WHITE));
286 } 283 }
287 set_random_color_coverage_stages(gpu, 284 set_random_color_coverage_stages(gpu,
(...skipping 25 matching lines...) Expand all
313 // create optimized draw state, setup readDst texture if required, and b uild a descriptor 310 // create optimized draw state, setup readDst texture if required, and b uild a descriptor
314 // and program. ODS creation can fail, so we have to check 311 // and program. ODS creation can fail, so we have to check
315 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy); 312 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy);
316 if (ods.mustSkip()) { 313 if (ods.mustSkip()) {
317 continue; 314 continue;
318 } 315 }
319 GrBatchTracker bt; 316 GrBatchTracker bt;
320 primProc->initBatchTracker(&bt, ods.getInitBatchTracker()); 317 primProc->initBatchTracker(&bt, ods.getInitBatchTracker());
321 318
322 GrProgramDesc desc; 319 GrProgramDesc desc;
323 gpu->buildProgramDesc(&desc, *primProc, ods, ods.descInfo(), drawType, b t); 320 gpu->buildProgramDesc(&desc, *primProc, ods, ods.descInfo(), bt);
324 321
325 GrGpu::DrawArgs args(primProc, &ods, &desc, &bt, drawType); 322 GrGpu::DrawArgs args(primProc, &ods, &desc, &bt);
326 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(args , gpu)); 323 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(args , gpu));
327 324
328 if (NULL == program.get()) { 325 if (NULL == program.get()) {
329 SkDebugf("Failed to create program!"); 326 SkDebugf("Failed to create program!");
330 return false; 327 return false;
331 } 328 }
332 329
333 // because occasionally optimized drawstate creation will fail for valid reasons, we only 330 // because occasionally optimized drawstate creation will fail for valid reasons, we only
334 // want to increment on success 331 // want to increment on success
335 ++t; 332 ++t;
(...skipping 29 matching lines...) Expand all
365 } 362 }
366 #endif 363 #endif
367 GrTestTarget target; 364 GrTestTarget target;
368 context->getTestTarget(&target); 365 context->getTestTarget(&target);
369 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages )); 366 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages ));
370 } 367 }
371 } 368 }
372 } 369 }
373 370
374 #endif 371 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698