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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 851143003: Remove willReadDst from GrFragmentProcessor. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferXP
Patch Set: Rebase Created 5 years, 11 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 int currTextureCoordSet = 0; 151 int currTextureCoordSet = 0;
152 for (int s = 0; s < numProcs;) { 152 for (int s = 0; s < numProcs;) {
153 SkAutoTUnref<const GrFragmentProcessor> fp( 153 SkAutoTUnref<const GrFragmentProcessor> fp(
154 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(random, 154 GrProcessorTestFactory<GrFragmentProcessor>::CreateStage(random,
155 gpu->ge tContext(), 155 gpu->ge tContext(),
156 *gpu->c aps(), 156 *gpu->c aps(),
157 dummyTe xtures)); 157 dummyTe xtures));
158 SkASSERT(fp); 158 SkASSERT(fp);
159 159
160 // don't add dst color reads to coverage stage
161 if (s >= numColorProcs && fp->willReadDstColor()) {
162 continue;
163 }
164
165 // If adding this effect would exceed the max texture coord set count th en generate a 160 // If adding this effect would exceed the max texture coord set count th en generate a
166 // new random effect. 161 // new random effect.
167 if (usePathRendering && gpu->glPathRendering()->texturingMode() == 162 if (usePathRendering && gpu->glPathRendering()->texturingMode() ==
168 GrGLPathRendering::FixedFunction_TexturingMode) {; 163 GrGLPathRendering::FixedFunction_TexturingMode) {;
169 int numTransforms = fp->numTransforms(); 164 int numTransforms = fp->numTransforms();
170 if (currTextureCoordSet + numTransforms > 165 if (currTextureCoordSet + numTransforms >
171 gpu->glCaps().maxFixedFunctionTextureCoords()) { 166 gpu->glCaps().maxFixedFunctionTextureCoords()) {
172 continue; 167 continue;
173 } 168 }
174 currTextureCoordSet += numTransforms; 169 currTextureCoordSet += numTransforms;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 set_random_stencil(&ds, &random); 298 set_random_stencil(&ds, &random);
304 299
305 GrDeviceCoordTexture dstCopy; 300 GrDeviceCoordTexture dstCopy;
306 301
307 const GrPrimitiveProcessor* primProc; 302 const GrPrimitiveProcessor* primProc;
308 if (hasGeometryProcessor) { 303 if (hasGeometryProcessor) {
309 primProc = gp.get(); 304 primProc = gp.get();
310 } else { 305 } else {
311 primProc = pathProc.get(); 306 primProc = pathProc.get();
312 } 307 }
313 if (!this->setupDstReadIfNecessary(&ds, primProc, &dstCopy, NULL)) { 308 if (!this->setupDstReadIfNecessary(&ds, &dstCopy, NULL)) {
314 SkDebugf("Couldn't setup dst read texture"); 309 SkDebugf("Couldn't setup dst read texture");
315 return false; 310 return false;
316 } 311 }
317 312
318 // create optimized draw state, setup readDst texture if required, and b uild a descriptor 313 // create optimized draw state, setup readDst texture if required, and b uild a descriptor
319 // and program. ODS creation can fail, so we have to check 314 // and program. ODS creation can fail, so we have to check
320 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy pe); 315 GrOptDrawState ods(ds, primProc, *gpu->caps(), scissor, &dstCopy, drawTy pe);
321 if (ods.mustSkip()) { 316 if (ods.mustSkip()) {
322 continue; 317 continue;
323 } 318 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 358 }
364 #endif 359 #endif
365 GrTestTarget target; 360 GrTestTarget target;
366 context->getTestTarget(&target); 361 context->getTestTarget(&target);
367 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages )); 362 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages ));
368 } 363 }
369 } 364 }
370 } 365 }
371 366
372 #endif 367 #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