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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 int numProcs = d->fRandom->nextULessThan(maxStages + 1); | 141 int numProcs = d->fRandom->nextULessThan(maxStages + 1); |
142 int numColorProcs = d->fRandom->nextULessThan(numProcs + 1); | 142 int numColorProcs = d->fRandom->nextULessThan(numProcs + 1); |
143 | 143 |
144 for (int s = 0; s < numProcs;) { | 144 for (int s = 0; s < numProcs;) { |
145 SkAutoTUnref<const GrFragmentProcessor> fp( | 145 SkAutoTUnref<const GrFragmentProcessor> fp( |
146 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(d)); | 146 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(d)); |
147 SkASSERT(fp); | 147 SkASSERT(fp); |
148 | 148 |
149 // finally add the stage to the correct pipeline in the drawstate | 149 // finally add the stage to the correct pipeline in the drawstate |
150 if (s < numColorProcs) { | 150 if (s < numColorProcs) { |
151 pipelineBuilder->addColorProcessor(fp); | 151 pipelineBuilder->addColorFragmentProcessor(fp); |
152 } else { | 152 } else { |
153 pipelineBuilder->addCoverageProcessor(fp); | 153 pipelineBuilder->addCoverageFragmentProcessor(fp); |
154 } | 154 } |
155 ++s; | 155 ++s; |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 static void set_random_state(GrPipelineBuilder* pipelineBuilder, SkRandom* rando
m) { | 159 static void set_random_state(GrPipelineBuilder* pipelineBuilder, SkRandom* rando
m) { |
160 int state = 0; | 160 int state = 0; |
161 for (int i = 1; i <= GrPipelineBuilder::kLast_Flag; i <<= 1) { | 161 for (int i = 1; i <= GrPipelineBuilder::kLast_Flag; i <<= 1) { |
162 state |= random->nextBool() * i; | 162 state |= random->nextBool() * i; |
163 } | 163 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
297 #endif | 297 #endif |
298 GrTestTarget target; | 298 GrTestTarget target; |
299 context->getTestTarget(&target); | 299 context->getTestTarget(&target); |
300 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context,
maxStages)); | 300 REPORTER_ASSERT(reporter, target.target()->programUnitTest(context,
maxStages)); |
301 } | 301 } |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 #endif | 305 #endif |
OLD | NEW |