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 |
| 392 GrProgramDesc desc; |
| 393 ((GrGpu*)gpu)->buildProgramDesc(ods, drawType, &desc); |
| 394 |
| 395 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(ods, |
| 396 desc
, |
| 397 draw
Type, |
| 398 gpu)
); |
392 if (NULL == program.get()) { | 399 if (NULL == program.get()) { |
393 SkDebugf("Failed to create program!"); | 400 SkDebugf("Failed to create program!"); |
394 return false; | 401 return false; |
395 } | 402 } |
396 | 403 |
397 // because occasionally optimized drawstate creation will fail for valid
reasons, we only | 404 // because occasionally optimized drawstate creation will fail for valid
reasons, we only |
398 // want to increment on success | 405 // want to increment on success |
399 ++t; | 406 ++t; |
400 } | 407 } |
401 return true; | 408 return true; |
(...skipping 27 matching lines...) Expand all Loading... |
429 } | 436 } |
430 #endif | 437 #endif |
431 GrTestTarget target; | 438 GrTestTarget target; |
432 context->getTestTarget(&target); | 439 context->getTestTarget(&target); |
433 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 440 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
434 } | 441 } |
435 } | 442 } |
436 } | 443 } |
437 | 444 |
438 #endif | 445 #endif |
OLD | NEW |