| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 int currTextureCoordSet = 0; | 151 int currTextureCoordSet = 0; |
| 152 for (int s = 0; s < numProcs;) { | 152 for (int s = 0; s < numProcs;) { |
| 153 SkAutoTUnref<const GrFragmentProcessor> fp( | 153 SkAutoTUnref<const GrFragmentProcessor> fp( |
| 154 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(random, | 154 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(random, |
| 155 gpu->ge
tContext(), | 155 gpu->ge
tContext(), |
| 156 *gpu->c
aps(), | 156 *gpu->c
aps(), |
| 157 dummyTe
xtures)); | 157 dummyTe
xtures)); |
| 158 SkASSERT(fp); | 158 SkASSERT(fp); |
| 159 | 159 |
| 160 // don't add dst color reads to coverage stage | |
| 161 if (s >= numColorProcs && fp->willReadDstColor()) { | |
| 162 continue; | |
| 163 } | |
| 164 | |
| 165 // If adding this effect would exceed the max texture coord set count th
en generate a | 160 // If adding this effect would exceed the max texture coord set count th
en generate a |
| 166 // new random effect. | 161 // new random effect. |
| 167 if (usePathRendering && gpu->glPathRendering()->texturingMode() == | 162 if (usePathRendering && gpu->glPathRendering()->texturingMode() == |
| 168 GrGLPathRendering::FixedFunction_TexturingMode)
{; | 163 GrGLPathRendering::FixedFunction_TexturingMode)
{; |
| 169 int numTransforms = fp->numTransforms(); | 164 int numTransforms = fp->numTransforms(); |
| 170 if (currTextureCoordSet + numTransforms > | 165 if (currTextureCoordSet + numTransforms > |
| 171 gpu->glCaps().maxFixedFunctionTextureCoords()) { | 166 gpu->glCaps().maxFixedFunctionTextureCoords()) { |
| 172 continue; | 167 continue; |
| 173 } | 168 } |
| 174 currTextureCoordSet += numTransforms; | 169 currTextureCoordSet += numTransforms; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 set_random_stencil(&ds, &random); | 298 set_random_stencil(&ds, &random); |
| 304 | 299 |
| 305 GrDeviceCoordTexture dstCopy; | 300 GrDeviceCoordTexture dstCopy; |
| 306 | 301 |
| 307 const GrPrimitiveProcessor* primProc; | 302 const GrPrimitiveProcessor* primProc; |
| 308 if (hasGeometryProcessor) { | 303 if (hasGeometryProcessor) { |
| 309 primProc = gp.get(); | 304 primProc = gp.get(); |
| 310 } else { | 305 } else { |
| 311 primProc = pathProc.get(); | 306 primProc = pathProc.get(); |
| 312 } | 307 } |
| 313 if (!this->setupDstReadIfNecessary(&ds, primProc, &dstCopy, NULL)) { | 308 if (!this->setupDstReadIfNecessary(&ds, &dstCopy, NULL)) { |
| 314 SkDebugf("Couldn't setup dst read texture"); | 309 SkDebugf("Couldn't setup dst read texture"); |
| 315 return false; | 310 return false; |
| 316 } | 311 } |
| 317 | 312 |
| 318 // 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 |
| 319 // and program. ODS creation can fail, so we have to check | 314 // and program. ODS creation can fail, so we have to check |
| 320 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy
pe); | 315 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy
pe); |
| 321 if (ods.mustSkip()) { | 316 if (ods.mustSkip()) { |
| 322 continue; | 317 continue; |
| 323 } | 318 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 358 } |
| 364 #endif | 359 #endif |
| 365 GrTestTarget target; | 360 GrTestTarget target; |
| 366 context->getTestTarget(&target); | 361 context->getTestTarget(&target); |
| 367 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 362 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
| 368 } | 363 } |
| 369 } | 364 } |
| 370 } | 365 } |
| 371 | 366 |
| 372 #endif | 367 #endif |
| OLD | NEW |