| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 kGenericVertexAttribs[*attribIndex].fBinding = binding; | 165 kGenericVertexAttribs[*attribIndex].fBinding = binding; |
| 166 *runningStride += GrVertexAttribTypeSize(kGenericVertexAttribs[(*attribI
ndex)++].fType); | 166 *runningStride += GrVertexAttribTypeSize(kGenericVertexAttribs[(*attribI
ndex)++].fType); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 static void set_random_gp(GrContext* context, | 170 static void set_random_gp(GrContext* context, |
| 171 const GrDrawTargetCaps& caps, | 171 const GrDrawTargetCaps& caps, |
| 172 GrDrawState* ds, | 172 GrDrawState* ds, |
| 173 SkRandom* random, | 173 SkRandom* random, |
| 174 GrTexture* dummyTextures[]) { | 174 GrTexture* dummyTextures[]) { |
| 175 GrProgramElementRef<const GrGeometryProcessor> gp( | 175 SkAutoTUnref<const GrGeometryProcessor> gp( |
| 176 GrProcessorTestFactory<GrGeometryProcessor>::CreateStage(random, | 176 GrProcessorTestFactory<GrGeometryProcessor>::CreateStage(random, |
| 177 context, | 177 context, |
| 178 caps, | 178 caps, |
| 179 dummyTextur
es)); | 179 dummyTextur
es)); |
| 180 SkASSERT(gp); | 180 SkASSERT(gp); |
| 181 | 181 |
| 182 // we have to set dummy vertex attributes, first we setup the fixed function
attributes | 182 // we have to set dummy vertex attributes, first we setup the fixed function
attributes |
| 183 // always leave the position attribute untouched in the array | 183 // always leave the position attribute untouched in the array |
| 184 int attribIndex = 1; | 184 int attribIndex = 1; |
| 185 int runningStride = GrVertexAttribTypeSize(kGenericVertexAttribs[0].fType); | 185 int runningStride = GrVertexAttribTypeSize(kGenericVertexAttribs[0].fType); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 GrDrawState* ds, | 221 GrDrawState* ds, |
| 222 int maxStages, | 222 int maxStages, |
| 223 bool usePathRendering, | 223 bool usePathRendering, |
| 224 SkRandom* random, | 224 SkRandom* random, |
| 225 GrTexture* dummyTextures[]) { | 225 GrTexture* dummyTextures[]) { |
| 226 int numProcs = random->nextULessThan(maxStages + 1); | 226 int numProcs = random->nextULessThan(maxStages + 1); |
| 227 int numColorProcs = random->nextULessThan(numProcs + 1); | 227 int numColorProcs = random->nextULessThan(numProcs + 1); |
| 228 | 228 |
| 229 int currTextureCoordSet = 0; | 229 int currTextureCoordSet = 0; |
| 230 for (int s = 0; s < numProcs;) { | 230 for (int s = 0; s < numProcs;) { |
| 231 GrProgramElementRef<GrFragmentProcessor> fp( | 231 SkAutoTUnref<const GrFragmentProcessor> fp( |
| 232 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(random, | 232 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(random, |
| 233 gpu->ge
tContext(), | 233 gpu->ge
tContext(), |
| 234 *gpu->c
aps(), | 234 *gpu->c
aps(), |
| 235 dummyTe
xtures)); | 235 dummyTe
xtures)); |
| 236 SkASSERT(fp); | 236 SkASSERT(fp); |
| 237 | 237 |
| 238 // don't add dst color reads to coverage stage | 238 // don't add dst color reads to coverage stage |
| 239 if (s >= numColorProcs && fp->willReadDstColor()) { | 239 if (s >= numColorProcs && fp->willReadDstColor()) { |
| 240 continue; | 240 continue; |
| 241 } | 241 } |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 } | 513 } |
| 514 #endif | 514 #endif |
| 515 GrTestTarget target; | 515 GrTestTarget target; |
| 516 context->getTestTarget(&target); | 516 context->getTestTarget(&target); |
| 517 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 517 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
| 518 } | 518 } |
| 519 } | 519 } |
| 520 } | 520 } |
| 521 | 521 |
| 522 #endif | 522 #endif |
| OLD | NEW |