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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 742853002: Don't use NULL GrOptDrawState to indicate that draw should be skipped. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make bool cast work Created 6 years, 1 month 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/GrOptDrawState.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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 GrDeviceCoordTexture dstCopy; 462 GrDeviceCoordTexture dstCopy;
463 463
464 if (!this->setupDstReadIfNecessary(&ds, &dstCopy, NULL)) { 464 if (!this->setupDstReadIfNecessary(&ds, &dstCopy, NULL)) {
465 SkDebugf("Couldn't setup dst read texture"); 465 SkDebugf("Couldn't setup dst read texture");
466 return false; 466 return false;
467 } 467 }
468 468
469 // create optimized draw state, setup readDst texture if required, and b uild a descriptor 469 // create optimized draw state, setup readDst texture if required, and b uild a descriptor
470 // and program. ODS creation can fail, so we have to check 470 // and program. ODS creation can fail, so we have to check
471 SkAutoTUnref<GrOptDrawState> ods(GrOptDrawState::Create(ds, 471 SkAutoTUnref<GrOptDrawState> ods
472 gpu, 472 SkNEW_ARGS(GrOptDrawState, (ds, gpu, scissor, &dstCopy, drawType));
473 scissor, 473 if (ods->mustSkip()) {
474 &dstCopy,
475 drawType));
476 if (!ods.get()) {
477 continue; 474 continue;
478 } 475 }
479 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(*ods , drawType, gpu)); 476 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(*ods , drawType, gpu));
480 if (NULL == program.get()) { 477 if (NULL == program.get()) {
481 SkDebugf("Failed to create program!"); 478 SkDebugf("Failed to create program!");
482 return false; 479 return false;
483 } 480 }
484 481
485 // because occasionally optimized drawstate creation will fail for valid reasons, we only 482 // because occasionally optimized drawstate creation will fail for valid reasons, we only
486 // want to increment on success 483 // want to increment on success
(...skipping 30 matching lines...) Expand all
517 } 514 }
518 #endif 515 #endif
519 GrTestTarget target; 516 GrTestTarget target;
520 context->getTestTarget(&target); 517 context->getTestTarget(&target);
521 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages )); 518 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages ));
522 } 519 }
523 } 520 }
524 } 521 }
525 522
526 #endif 523 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrOptDrawState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698