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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 set_random_stencil(&pipelineBuilder, &random); | 291 set_random_stencil(&pipelineBuilder, &random); |
292 | 292 |
293 GrDeviceCoordTexture dstCopy; | 293 GrDeviceCoordTexture dstCopy; |
294 | 294 |
295 const GrPrimitiveProcessor* primProc; | 295 const GrPrimitiveProcessor* primProc; |
296 if (hasGeometryProcessor) { | 296 if (hasGeometryProcessor) { |
297 primProc = gp.get(); | 297 primProc = gp.get(); |
298 } else { | 298 } else { |
299 primProc = pathProc.get(); | 299 primProc = pathProc.get(); |
300 } | 300 } |
301 if (!this->setupDstReadIfNecessary(pipelineBuilder, &dstCopy, NULL)) { | 301 |
| 302 const GrProcOptInfo& colorPOI = pipelineBuilder.colorProcInfo(primProc); |
| 303 const GrProcOptInfo& coveragePOI = pipelineBuilder.coverageProcInfo(prim
Proc); |
| 304 |
| 305 if (!this->setupDstReadIfNecessary(pipelineBuilder, colorPOI, coveragePO
I, &dstCopy, |
| 306 NULL)) { |
302 SkDebugf("Couldn't setup dst read texture"); | 307 SkDebugf("Couldn't setup dst read texture"); |
303 return false; | 308 return false; |
304 } | 309 } |
305 | 310 |
306 // create optimized draw state, setup readDst texture if required, and b
uild a descriptor | 311 // create optimized draw state, setup readDst texture if required, and b
uild a descriptor |
307 // and program. ODS creation can fail, so we have to check | 312 // and program. ODS creation can fail, so we have to check |
308 GrPipeline pipeline(pipelineBuilder, primProc, *gpu->caps(), scissor, &d
stCopy); | 313 GrPipeline pipeline(pipelineBuilder, colorPOI, coveragePOI, |
| 314 *gpu->caps(), scissor, &dstCopy); |
309 if (pipeline.mustSkip()) { | 315 if (pipeline.mustSkip()) { |
310 continue; | 316 continue; |
311 } | 317 } |
312 GrBatchTracker bt; | 318 GrBatchTracker bt; |
313 primProc->initBatchTracker(&bt, pipeline.getInitBatchTracker()); | 319 primProc->initBatchTracker(&bt, pipeline.getInitBatchTracker()); |
314 | 320 |
315 GrProgramDesc desc; | 321 GrProgramDesc desc; |
316 gpu->buildProgramDesc(&desc, *primProc, pipeline, bt); | 322 gpu->buildProgramDesc(&desc, *primProc, pipeline, bt); |
317 | 323 |
318 GrGpu::DrawArgs args(primProc, &pipeline, &desc, &bt); | 324 GrGpu::DrawArgs args(primProc, &pipeline, &desc, &bt); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 364 } |
359 #endif | 365 #endif |
360 GrTestTarget target; | 366 GrTestTarget target; |
361 context->getTestTarget(&target); | 367 context->getTestTarget(&target); |
362 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 368 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
363 } | 369 } |
364 } | 370 } |
365 } | 371 } |
366 | 372 |
367 #endif | 373 #endif |
OLD | NEW |