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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } else { | 305 } else { |
306 primProc = pathProc.get(); | 306 primProc = pathProc.get(); |
307 } | 307 } |
308 if (!this->setupDstReadIfNecessary(&ds, &dstCopy, NULL)) { | 308 if (!this->setupDstReadIfNecessary(&ds, &dstCopy, NULL)) { |
309 SkDebugf("Couldn't setup dst read texture"); | 309 SkDebugf("Couldn't setup dst read texture"); |
310 return false; | 310 return false; |
311 } | 311 } |
312 | 312 |
313 // create optimized draw state, setup readDst texture if required, and b
uild a descriptor | 313 // create optimized draw state, setup readDst texture if required, and b
uild a descriptor |
314 // and program. ODS creation can fail, so we have to check | 314 // and program. ODS creation can fail, so we have to check |
315 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy
pe); | 315 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy); |
316 if (ods.mustSkip()) { | 316 if (ods.mustSkip()) { |
317 continue; | 317 continue; |
318 } | 318 } |
319 GrBatchTracker bt; | 319 GrBatchTracker bt; |
320 primProc->initBatchTracker(&bt, ods.getInitBatchTracker()); | 320 primProc->initBatchTracker(&bt, ods.getInitBatchTracker()); |
321 | 321 |
322 GrProgramDesc desc; | 322 GrProgramDesc desc; |
323 gpu->buildProgramDesc(&desc, *primProc, ods, ods.descInfo(), ods.drawTyp
e(), bt); | 323 gpu->buildProgramDesc(&desc, *primProc, ods, ods.descInfo(), drawType, b
t); |
324 | 324 |
325 GrGpu::DrawArgs args(primProc, &ods, &desc, &bt); | 325 GrGpu::DrawArgs args(primProc, &ods, &desc, &bt, drawType); |
326 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(args
, gpu)); | 326 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(args
, gpu)); |
327 | 327 |
328 if (NULL == program.get()) { | 328 if (NULL == program.get()) { |
329 SkDebugf("Failed to create program!"); | 329 SkDebugf("Failed to create program!"); |
330 return false; | 330 return false; |
331 } | 331 } |
332 | 332 |
333 // because occasionally optimized drawstate creation will fail for valid
reasons, we only | 333 // because occasionally optimized drawstate creation will fail for valid
reasons, we only |
334 // want to increment on success | 334 // want to increment on success |
335 ++t; | 335 ++t; |
(...skipping 29 matching lines...) Expand all Loading... |
365 } | 365 } |
366 #endif | 366 #endif |
367 GrTestTarget target; | 367 GrTestTarget target; |
368 context->getTestTarget(&target); | 368 context->getTestTarget(&target); |
369 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 369 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
370 } | 370 } |
371 } | 371 } |
372 } | 372 } |
373 | 373 |
374 #endif | 374 #endif |
OLD | NEW |