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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 815643005: Move program descriptor and primitive processor off of optstate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: small cleanup 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
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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 SkDebugf("Couldn't setup dst read texture"); 314 SkDebugf("Couldn't setup dst read texture");
315 return false; 315 return false;
316 } 316 }
317 317
318 // create optimized draw state, setup readDst texture if required, and b uild a descriptor 318 // create optimized draw state, setup readDst texture if required, and b uild a descriptor
319 // and program. ODS creation can fail, so we have to check 319 // and program. ODS creation can fail, so we have to check
320 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy pe); 320 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy pe);
321 if (ods.mustSkip()) { 321 if (ods.mustSkip()) {
322 continue; 322 continue;
323 } 323 }
324 ods.finalize(gpu); 324 GrBatchTracker bt;
325 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(ods, gpu)); 325 primProc->initBatchTracker(&bt, ods.getInitBatchTracker());
326
327 GrProgramDesc desc;
328 gpu->buildProgramDesc(&desc, *primProc, ods, ods.descInfo(), ods.drawTyp e(), bt);
329
330 GrGpu::DrawArgs args(*primProc, ods, desc, bt);
331 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(args , gpu));
332
326 if (NULL == program.get()) { 333 if (NULL == program.get()) {
327 SkDebugf("Failed to create program!"); 334 SkDebugf("Failed to create program!");
328 return false; 335 return false;
329 } 336 }
330 337
331 // because occasionally optimized drawstate creation will fail for valid reasons, we only 338 // because occasionally optimized drawstate creation will fail for valid reasons, we only
332 // want to increment on success 339 // want to increment on success
333 ++t; 340 ++t;
334 } 341 }
335 return true; 342 return true;
(...skipping 27 matching lines...) Expand all
363 } 370 }
364 #endif 371 #endif
365 GrTestTarget target; 372 GrTestTarget target;
366 context->getTestTarget(&target); 373 context->getTestTarget(&target);
367 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages )); 374 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages ));
368 } 375 }
369 } 376 }
370 } 377 }
371 378
372 #endif 379 #endif
OLDNEW
« src/gpu/GrGpu.h ('K') | « src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698