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

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: bug fix 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/GrGLVertexShaderBuilder.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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 SkDebugf("Couldn't setup dst read texture"); 309 SkDebugf("Couldn't setup dst read texture");
310 return false; 310 return false;
311 } 311 }
312 312
313 // create optimized draw state, setup readDst texture if required, and b uild a descriptor 313 // 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 314 // and program. ODS creation can fail, so we have to check
315 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy pe); 315 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy pe);
316 if (ods.mustSkip()) { 316 if (ods.mustSkip()) {
317 continue; 317 continue;
318 } 318 }
319 ods.finalize(gpu); 319 GrBatchTracker bt;
320 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(ods, gpu)); 320 primProc->initBatchTracker(&bt, ods.getInitBatchTracker());
321
322 GrProgramDesc desc;
323 gpu->buildProgramDesc(&desc, *primProc, ods, ods.descInfo(), ods.drawTyp e(), bt);
324
325 GrGpu::DrawArgs args(primProc, &ods, &desc, &bt);
326 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(args , gpu));
327
321 if (NULL == program.get()) { 328 if (NULL == program.get()) {
322 SkDebugf("Failed to create program!"); 329 SkDebugf("Failed to create program!");
323 return false; 330 return false;
324 } 331 }
325 332
326 // because occasionally optimized drawstate creation will fail for valid reasons, we only 333 // because occasionally optimized drawstate creation will fail for valid reasons, we only
327 // want to increment on success 334 // want to increment on success
328 ++t; 335 ++t;
329 } 336 }
330 return true; 337 return true;
(...skipping 27 matching lines...) Expand all
358 } 365 }
359 #endif 366 #endif
360 GrTestTarget target; 367 GrTestTarget target;
361 context->getTestTarget(&target); 368 context->getTestTarget(&target);
362 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages )); 369 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages ));
363 } 370 }
364 } 371 }
365 } 372 }
366 373
367 #endif 374 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698