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

Side by Side Diff: src/gpu/gl/GrGLProgram.h

Issue 13069003: Replace edge types with GrEdgeEffect. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef GrGLProgram_DEFINED 9 #ifndef GrGLProgram_DEFINED
10 #define GrGLProgram_DEFINED 10 #define GrGLProgram_DEFINED
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // secondary source is output and what value it holds. 158 // secondary source is output and what value it holds.
159 enum DualSrcOutput { 159 enum DualSrcOutput {
160 kNone_DualSrcOutput, 160 kNone_DualSrcOutput,
161 kCoverage_DualSrcOutput, 161 kCoverage_DualSrcOutput,
162 kCoverageISA_DualSrcOutput, 162 kCoverageISA_DualSrcOutput,
163 kCoverageISC_DualSrcOutput, 163 kCoverageISC_DualSrcOutput,
164 164
165 kDualSrcOutputCnt 165 kDualSrcOutputCnt
166 }; 166 };
167 167
168 // TODO: remove these two members when edge-aa can be rewritten as a GrE ffect.
169 GrDrawState::VertexEdgeType fVertexEdgeType;
170 // should the FS discard if the edge-aa coverage is zero (to avoid stenc il manipulation) 168 // should the FS discard if the edge-aa coverage is zero (to avoid stenc il manipulation)
171 bool fDiscardIfOutsideEdge; 169 bool fDiscardIfOutsideEdge;
172 170
173 // stripped of bits that don't affect program generation 171 // stripped of bits that don't affect program generation
174 GrAttribBindings fAttribBindings; 172 GrAttribBindings fAttribBindings;
175 173
176 /** Non-zero if this stage has an effect */ 174 /** Non-zero if this stage has an effect */
177 GrGLEffect::EffectKey fEffectKeys[GrDrawState::kNumStages]; 175 GrGLEffect::EffectKey fEffectKeys[GrDrawState::kNumStages];
178 176
179 // To enable experimental geometry shader code (not for use in 177 // To enable experimental geometry shader code (not for use in
180 // production) 178 // production)
181 #if GR_GL_EXPERIMENTAL_GS 179 #if GR_GL_EXPERIMENTAL_GS
182 bool fExperimentalGS; 180 bool fExperimentalGS;
183 #endif 181 #endif
184 uint8_t fColorInput; // casts to enum Col orInput 182 uint8_t fColorInput; // casts to enum Col orInput
185 uint8_t fCoverageInput; // casts to enum Col orInput 183 uint8_t fCoverageInput; // casts to enum Col orInput
186 uint8_t fDualSrcOutput; // casts to enum Dua lSrcOutput 184 uint8_t fDualSrcOutput; // casts to enum Dua lSrcOutput
187 int8_t fFirstCoverageStage; 185 int8_t fFirstCoverageStage;
188 SkBool8 fEmitsPointSize; 186 SkBool8 fEmitsPointSize;
189 uint8_t fColorFilterXfermode; // casts to enum SkX fermode::Mode 187 uint8_t fColorFilterXfermode; // casts to enum SkX fermode::Mode
190 188
191 int8_t fPositionAttributeIndex; 189 int8_t fPositionAttributeIndex;
192 int8_t fColorAttributeIndex; 190 int8_t fColorAttributeIndex;
193 int8_t fCoverageAttributeIndex; 191 int8_t fCoverageAttributeIndex;
194 int8_t fEdgeAttributeIndex;
195 int8_t fLocalCoordsAttributeIndex; 192 int8_t fLocalCoordsAttributeIndex;
196 193
197 friend class GrGLProgram; 194 friend class GrGLProgram;
198 }; 195 };
199 196
200 // Layout information for OpenGL vertex attributes 197 // Layout information for OpenGL vertex attributes
201 struct AttribLayout { 198 struct AttribLayout {
202 GrGLint fCount; 199 GrGLint fCount;
203 GrGLenum fType; 200 GrGLenum fType;
204 GrGLboolean fNormalized; 201 GrGLboolean fNormalized;
(...skipping 13 matching lines...) Expand all
218 bool genProgram(const GrEffectStage* stages[]); 215 bool genProgram(const GrEffectStage* stages[]);
219 216
220 void genInputColor(GrGLShaderBuilder* builder, SkString* inColor); 217 void genInputColor(GrGLShaderBuilder* builder, SkString* inColor);
221 218
222 void genGeometryShader(GrGLShaderBuilder* segments) const; 219 void genGeometryShader(GrGLShaderBuilder* segments) const;
223 220
224 typedef GrGLUniformManager::UniformHandle UniformHandle; 221 typedef GrGLUniformManager::UniformHandle UniformHandle;
225 222
226 void genUniformCoverage(GrGLShaderBuilder* segments, SkString* inOutCoverage ); 223 void genUniformCoverage(GrGLShaderBuilder* segments, SkString* inOutCoverage );
227 224
228 // generates code to compute coverage based on edge AA. Returns true if edge coverage was
229 // inserted in which case coverageVar will be updated to refer to a scalar. Otherwise,
230 // coverageVar is set to an empty string.
231 bool genEdgeCoverage(SkString* coverageVar, GrGLShaderBuilder* builder) cons t;
232
233 // Creates a GL program ID, binds shader attributes to GL vertex attrs, and links the program 225 // Creates a GL program ID, binds shader attributes to GL vertex attrs, and links the program
234 bool bindOutputsAttribsAndLinkProgram(const GrGLShaderBuilder& builder, 226 bool bindOutputsAttribsAndLinkProgram(const GrGLShaderBuilder& builder,
235 bool bindColorOut, 227 bool bindColorOut,
236 bool bindDualSrcOut); 228 bool bindDualSrcOut);
237 229
238 // Sets the texture units for samplers 230 // Sets the texture units for samplers
239 void initSamplerUniforms(); 231 void initSamplerUniforms();
240 232
241 bool compileShaders(const GrGLShaderBuilder& builder); 233 bool compileShaders(const GrGLShaderBuilder& builder);
242 234
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 Desc fDesc; 284 Desc fDesc;
293 const GrGLContext& fContext; 285 const GrGLContext& fContext;
294 286
295 GrGLUniformManager fUniformManager; 287 GrGLUniformManager fUniformManager;
296 UniformHandles fUniformHandles; 288 UniformHandles fUniformHandles;
297 289
298 typedef GrRefCnt INHERITED; 290 typedef GrRefCnt INHERITED;
299 }; 291 };
300 292
301 #endif 293 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698