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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->caps(), scissor, &dstCopy, drawType); | 387 GrOptDrawState ods(ds, gpu, scissor, &dstCopy, drawType); |
388 if (ods.mustSkip()) { | 388 if (ods.mustSkip()) { |
389 continue; | 389 continue; |
390 } | 390 } |
391 ods.finalize(gpu); | 391 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(ods,
drawType, gpu)); |
392 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(ods,
gpu)); | |
393 if (NULL == program.get()) { | 392 if (NULL == program.get()) { |
394 SkDebugf("Failed to create program!"); | 393 SkDebugf("Failed to create program!"); |
395 return false; | 394 return false; |
396 } | 395 } |
397 | 396 |
398 // because occasionally optimized drawstate creation will fail for valid
reasons, we only | 397 // because occasionally optimized drawstate creation will fail for valid
reasons, we only |
399 // want to increment on success | 398 // want to increment on success |
400 ++t; | 399 ++t; |
401 } | 400 } |
402 return true; | 401 return true; |
(...skipping 27 matching lines...) Expand all Loading... |
430 } | 429 } |
431 #endif | 430 #endif |
432 GrTestTarget target; | 431 GrTestTarget target; |
433 context->getTestTarget(&target); | 432 context->getTestTarget(&target); |
434 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 433 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
435 } | 434 } |
436 } | 435 } |
437 } | 436 } |
438 | 437 |
439 #endif | 438 #endif |
OLD | NEW |