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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 const int maxTreeLevels = 4; | 241 const int maxTreeLevels = 4; |
242 SkAutoTUnref<const GrFragmentProcessor> fp( | 242 SkAutoTUnref<const GrFragmentProcessor> fp( |
243 create_random_proc_tree(d, 2, maxTreeLev
els)); | 243 create_random_proc_tree(d, 2, maxTreeLev
els)); |
244 pipelineBuilder->addColorFragmentProcessor(fp); | 244 pipelineBuilder->addColorFragmentProcessor(fp); |
245 } else { | 245 } else { |
246 int numProcs = d->fRandom->nextULessThan(maxStages + 1); | 246 int numProcs = d->fRandom->nextULessThan(maxStages + 1); |
247 int numColorProcs = d->fRandom->nextULessThan(numProcs + 1); | 247 int numColorProcs = d->fRandom->nextULessThan(numProcs + 1); |
248 | 248 |
249 for (int s = 0; s < numProcs;) { | 249 for (int s = 0; s < numProcs;) { |
250 SkAutoTUnref<const GrFragmentProcessor> fp( | 250 SkAutoTUnref<const GrFragmentProcessor> fp( |
251 GrProcessorTestFactory<GrFragmentProcessor>::Create(d)); | 251 GrProcessorTestFactory<GrFragmentProcessor>::Create(d)); |
252 SkASSERT(fp); | 252 SkASSERT(fp); |
253 | 253 |
254 // finally add the stage to the correct pipeline in the drawstate | 254 // finally add the stage to the correct pipeline in the drawstate |
255 if (s < numColorProcs) { | 255 if (s < numColorProcs) { |
256 pipelineBuilder->addColorFragmentProcessor(fp); | 256 pipelineBuilder->addColorFragmentProcessor(fp); |
257 } else { | 257 } else { |
258 pipelineBuilder->addCoverageFragmentProcessor(fp); | 258 pipelineBuilder->addCoverageFragmentProcessor(fp); |
259 } | 259 } |
260 ++s; | 260 ++s; |
261 } | 261 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 #endif | 443 #endif |
444 GrTestTarget target; | 444 GrTestTarget target; |
445 context->getTestTarget(&target); | 445 context->getTestTarget(&target); |
446 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context,
maxStages)); | 446 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context,
maxStages)); |
447 } | 447 } |
448 } | 448 } |
449 } | 449 } |
450 | 450 |
451 #endif | 451 #endif |
OLD | NEW |