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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 154623002: Stop discarding in frag shader when coverage is zero and stencil writes are enabled (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: save all the files Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && 58 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
59 kAttribute_ColorInput == header->fCoverageInput); 59 kAttribute_ColorInput == header->fCoverageInput);
60 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ? 60 header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_Colo rInput) ?
61 currAttribIndex++ : 61 currAttribIndex++ :
62 -1; 62 -1;
63 63
64 #if GR_GL_EXPERIMENTAL_GS 64 #if GR_GL_EXPERIMENTAL_GS
65 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool(); 65 header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->ne xtBool();
66 #endif 66 #endif
67 67
68 header->fDiscardIfZeroCoverage = random->nextBool();
69
70 bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::k MaxVertexAttribCnt; 68 bool useLocalCoords = random->nextBool() && currAttribIndex < GrDrawState::k MaxVertexAttribCnt;
71 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1; 69 header->fLocalCoordAttributeIndex = useLocalCoords ? currAttribIndex++ : -1;
72 70
73 header->fColorEffectCnt = numColorStages; 71 header->fColorEffectCnt = numColorStages;
74 header->fCoverageEffectCnt = numCoverageStages; 72 header->fCoverageEffectCnt = numCoverageStages;
75 73
76 bool dstRead = false; 74 bool dstRead = false;
77 bool fragPos = false; 75 bool fragPos = false;
78 bool vertexCode = false; 76 bool vertexCode = false;
79 int numStages = numColorStages + numCoverageStages; 77 int numStages = numColorStages + numCoverageStages;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar 1); 260 SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar 1);
263 GrConfigConversionEffect::Create(NULL, 261 GrConfigConversionEffect::Create(NULL,
264 false, 262 false,
265 GrConfigConversionEffect::kNone_PMConversio n, 263 GrConfigConversionEffect::kNone_PMConversio n,
266 SkMatrix::I()); 264 SkMatrix::I());
267 SkScalar matrix[20]; 265 SkScalar matrix[20];
268 SkColorMatrixFilter cmf(matrix); 266 SkColorMatrixFilter cmf(matrix);
269 } 267 }
270 268
271 #endif 269 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698