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, 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 Loading... |
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 |
OLD | NEW |