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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 777673003: move program descriptor generation to flush (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix builder bug Created 6 years 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 GrDeviceCoordTexture dstCopy; 378 GrDeviceCoordTexture dstCopy;
379 379
380 if (!this->setupDstReadIfNecessary(&ds, &dstCopy, NULL)) { 380 if (!this->setupDstReadIfNecessary(&ds, &dstCopy, NULL)) {
381 SkDebugf("Couldn't setup dst read texture"); 381 SkDebugf("Couldn't setup dst read texture");
382 return false; 382 return false;
383 } 383 }
384 384
385 // create optimized draw state, setup readDst texture if required, and b uild a descriptor 385 // create optimized draw state, setup readDst texture if required, and b uild a descriptor
386 // and program. ODS creation can fail, so we have to check 386 // and program. ODS creation can fail, so we have to check
387 GrOptDrawState ods(ds, gpu, scissor, &dstCopy, drawType); 387 GrOptDrawState ods(ds, *gpu->caps(), scissor, &dstCopy, drawType);
388 if (ods.mustSkip()) { 388 if (ods.mustSkip()) {
389 continue; 389 continue;
390 } 390 }
391 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(ods, drawType, gpu)); 391 ods.finalize(gpu);
392 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(ods, gpu));
392 if (NULL == program.get()) { 393 if (NULL == program.get()) {
393 SkDebugf("Failed to create program!"); 394 SkDebugf("Failed to create program!");
394 return false; 395 return false;
395 } 396 }
396 397
397 // because occasionally optimized drawstate creation will fail for valid reasons, we only 398 // because occasionally optimized drawstate creation will fail for valid reasons, we only
398 // want to increment on success 399 // want to increment on success
399 ++t; 400 ++t;
400 } 401 }
401 return true; 402 return true;
(...skipping 27 matching lines...) Expand all
429 } 430 }
430 #endif 431 #endif
431 GrTestTarget target; 432 GrTestTarget target;
432 context->getTestTarget(&target); 433 context->getTestTarget(&target);
433 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages )); 434 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages ));
434 } 435 }
435 } 436 }
436 } 437 }
437 438
438 #endif 439 #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