OLD | NEW |
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 Loading... |
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 | 471 GrOptDrawState ods(ds, gpu, scissor, &dstCopy, drawType); |
472 SkNEW_ARGS(GrOptDrawState, (ds, gpu, scissor, &dstCopy, drawType)); | 472 if (ods.mustSkip()) { |
473 if (ods->mustSkip()) { | |
474 continue; | 473 continue; |
475 } | 474 } |
476 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(*ods
, drawType, gpu)); | 475 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(ods,
drawType, gpu)); |
477 if (NULL == program.get()) { | 476 if (NULL == program.get()) { |
478 SkDebugf("Failed to create program!"); | 477 SkDebugf("Failed to create program!"); |
479 return false; | 478 return false; |
480 } | 479 } |
481 | 480 |
482 // because occasionally optimized drawstate creation will fail for valid
reasons, we only | 481 // because occasionally optimized drawstate creation will fail for valid
reasons, we only |
483 // want to increment on success | 482 // want to increment on success |
484 ++t; | 483 ++t; |
485 } | 484 } |
486 return true; | 485 return true; |
(...skipping 27 matching lines...) Expand all Loading... |
514 } | 513 } |
515 #endif | 514 #endif |
516 GrTestTarget target; | 515 GrTestTarget target; |
517 context->getTestTarget(&target); | 516 context->getTestTarget(&target); |
518 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 517 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
519 } | 518 } |
520 } | 519 } |
521 } | 520 } |
522 | 521 |
523 #endif | 522 #endif |
OLD | NEW |