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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 739673002: Create GrOptDrawState before recording draw in GrInOrderDrawBuffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused function in pendingprogramelement Created 6 years, 1 month 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
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