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 if (!this->setupDstReadIfNecessary(&pipelineBuilder, &dstCopy, NULL)) { |
302 SkDebugf("Couldn't setup dst read texture"); | 302 SkDebugf("Couldn't setup dst read texture"); |
303 return false; | 303 return false; |
304 } | 304 } |
305 | 305 |
306 // create optimized draw state, setup readDst texture if required, and b
uild a descriptor | 306 // 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 | 307 // and program. ODS creation can fail, so we have to check |
308 GrPipeline pipeline(pipelineBuilder, primProc, *gpu->caps(), scissor, &d
stCopy); | 308 GrPipeline pipeline(pipelineBuilder, primProc, *gpu->caps(), scissor, &d
stCopy); |
309 if (pipeline.mustSkip()) { | 309 if (pipeline.mustSkip()) { |
310 continue; | 310 continue; |
311 } | 311 } |
312 GrBatchTracker bt; | 312 GrBatchTracker bt; |
313 primProc->initBatchTracker(&bt, pipeline.getInitBatchTracker()); | 313 primProc->initBatchTracker(&bt, pipeline.getInitBatchTracker()); |
314 | 314 |
315 GrProgramDesc desc; | 315 GrProgramDesc desc; |
316 gpu->buildProgramDesc(&desc, *primProc, pipeline, bt); | 316 gpu->buildProgramDesc(&desc, *primProc, pipeline, pipeline.descInfo(), b
t); |
317 | 317 |
318 GrGpu::DrawArgs args(primProc, &pipeline, &desc, &bt); | 318 GrGpu::DrawArgs args(primProc, &pipeline, &desc, &bt); |
319 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(args
, gpu)); | 319 SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(args
, gpu)); |
320 | 320 |
321 if (NULL == program.get()) { | 321 if (NULL == program.get()) { |
322 SkDebugf("Failed to create program!"); | 322 SkDebugf("Failed to create program!"); |
323 return false; | 323 return false; |
324 } | 324 } |
325 | 325 |
326 // because occasionally optimized drawstate creation will fail for valid
reasons, we only | 326 // because occasionally optimized drawstate creation will fail for valid
reasons, we only |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 358 } |
359 #endif | 359 #endif |
360 GrTestTarget target; | 360 GrTestTarget target; |
361 context->getTestTarget(&target); | 361 context->getTestTarget(&target); |
362 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 362 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
363 } | 363 } |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 #endif | 367 #endif |
OLD | NEW |