Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 1110553003: Remove legacy NVPR support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 static void set_random_color_coverage_stages(GrGLGpu* gpu, 147 static void set_random_color_coverage_stages(GrGLGpu* gpu,
148 GrPipelineBuilder* pipelineBuilder, 148 GrPipelineBuilder* pipelineBuilder,
149 int maxStages, 149 int maxStages,
150 bool usePathRendering, 150 bool usePathRendering,
151 SkRandom* random, 151 SkRandom* random,
152 GrTexture* dummyTextures[]) { 152 GrTexture* dummyTextures[]) {
153 int numProcs = random->nextULessThan(maxStages + 1); 153 int numProcs = random->nextULessThan(maxStages + 1);
154 int numColorProcs = random->nextULessThan(numProcs + 1); 154 int numColorProcs = random->nextULessThan(numProcs + 1);
155 155
156 int currTextureCoordSet = 0;
157 for (int s = 0; s < numProcs;) { 156 for (int s = 0; s < numProcs;) {
158 SkAutoTUnref<const GrFragmentProcessor> fp( 157 SkAutoTUnref<const GrFragmentProcessor> fp(
159 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(random, 158 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(random,
160 gpu->ge tContext(), 159 gpu->ge tContext(),
161 *gpu->c aps(), 160 *gpu->c aps(),
162 dummyTe xtures)); 161 dummyTe xtures));
163 SkASSERT(fp); 162 SkASSERT(fp);
164 163
165 // If adding this effect would exceed the max texture coord set count th en generate a
166 // new random effect.
167 if (usePathRendering && gpu->glPathRendering()->texturingMode() ==
168 GrGLPathRendering::FixedFunction_TexturingMode) {;
169 int numTransforms = fp->numTransforms();
170 if (currTextureCoordSet + numTransforms >
171 gpu->glCaps().maxFixedFunctionTextureCoords()) {
172 continue;
173 }
174 currTextureCoordSet += numTransforms;
175 }
176
177 // finally add the stage to the correct pipeline in the drawstate 164 // finally add the stage to the correct pipeline in the drawstate
178 if (s < numColorProcs) { 165 if (s < numColorProcs) {
179 pipelineBuilder->addColorProcessor(fp); 166 pipelineBuilder->addColorProcessor(fp);
180 } else { 167 } else {
181 pipelineBuilder->addCoverageProcessor(fp); 168 pipelineBuilder->addCoverageProcessor(fp);
182 } 169 }
183 ++s; 170 ++s;
184 } 171 }
185 } 172 }
186 173
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 360 }
374 #endif 361 #endif
375 GrTestTarget target; 362 GrTestTarget target;
376 context->getTestTarget(&target); 363 context->getTestTarget(&target);
377 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages )); 364 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages ));
378 } 365 }
379 } 366 }
380 } 367 }
381 368
382 #endif 369 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698