| OLD | NEW |
| 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 Loading... |
| 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 struct AttribPair { |
| 169 void set(int index, const char* name) { |
| 170 fIndex = index; fName = name; |
| 171 } |
| 172 int fIndex; |
| 173 const char* fName; |
| 174 }; |
| 175 |
| 168 // TODO: remove these two members when edge-aa can be rewritten as a GrE
ffect. | 176 // TODO: remove these two members when edge-aa can be rewritten as a GrE
ffect. |
| 169 GrDrawState::VertexEdgeType fVertexEdgeType; | 177 GrDrawState::VertexEdgeType fVertexEdgeType; |
| 170 // should the FS discard if the edge-aa coverage is zero (to avoid stenc
il manipulation) | 178 // should the FS discard if the edge-aa coverage is zero (to avoid stenc
il manipulation) |
| 171 bool fDiscardIfOutsideEdge; | 179 bool fDiscardIfOutsideEdge; |
| 172 | 180 |
| 173 // stripped of bits that don't affect program generation | 181 // stripped of bits that don't affect program generation |
| 174 GrAttribBindings fAttribBindings; | 182 GrAttribBindings fAttribBindings; |
| 175 | 183 |
| 176 /** Non-zero if this stage has an effect */ | 184 /** Non-zero if this stage has an effect */ |
| 177 GrGLEffect::EffectKey fEffectKeys[GrDrawState::kNumStages]; | 185 GrGLEffect::EffectKey fEffectKeys[GrDrawState::kNumStages]; |
| 178 | 186 |
| 179 // To enable experimental geometry shader code (not for use in | 187 // To enable experimental geometry shader code (not for use in |
| 180 // production) | 188 // production) |
| 181 #if GR_GL_EXPERIMENTAL_GS | 189 #if GR_GL_EXPERIMENTAL_GS |
| 182 bool fExperimentalGS; | 190 bool fExperimentalGS; |
| 183 #endif | 191 #endif |
| 184 uint8_t fColorInput; // casts to enum Col
orInput | 192 uint8_t fColorInput; // casts to enum Col
orInput |
| 185 uint8_t fCoverageInput; // casts to enum Col
orInput | 193 uint8_t fCoverageInput; // casts to enum Col
orInput |
| 186 uint8_t fDualSrcOutput; // casts to enum Dua
lSrcOutput | 194 uint8_t fDualSrcOutput; // casts to enum Dua
lSrcOutput |
| 187 int8_t fFirstCoverageStage; | 195 int8_t fFirstCoverageStage; |
| 188 SkBool8 fEmitsPointSize; | 196 SkBool8 fEmitsPointSize; |
| 189 uint8_t fColorFilterXfermode; // casts to enum SkX
fermode::Mode | 197 uint8_t fColorFilterXfermode; // casts to enum SkX
fermode::Mode |
| 190 | 198 |
| 191 int8_t fPositionAttributeIndex; | 199 int8_t fPositionAttributeIndex; |
| 192 int8_t fColorAttributeIndex; | 200 int8_t fColorAttributeIndex; |
| 193 int8_t fCoverageAttributeIndex; | 201 int8_t fCoverageAttributeIndex; |
| 194 int8_t fEdgeAttributeIndex; | 202 int8_t fEdgeAttributeIndex; |
| 195 int8_t fTexCoordAttributeIndex; | 203 int8_t fTexCoordAttributeIndex; |
| 196 | 204 |
| 205 SkSTArray<2, AttribPair, true> fEffectAttributes; |
| 206 |
| 197 friend class GrGLProgram; | 207 friend class GrGLProgram; |
| 198 }; | 208 }; |
| 199 | 209 |
| 200 // Layout information for OpenGL vertex attributes | 210 // Layout information for OpenGL vertex attributes |
| 201 struct AttribLayout { | 211 struct AttribLayout { |
| 202 GrGLint fCount; | 212 GrGLint fCount; |
| 203 GrGLenum fType; | 213 GrGLenum fType; |
| 204 GrGLboolean fNormalized; | 214 GrGLboolean fNormalized; |
| 205 }; | 215 }; |
| 206 static const AttribLayout kAttribLayouts[kGrVertexAttribTypeCount]; | 216 static const AttribLayout kAttribLayouts[kGrVertexAttribTypeCount]; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 Desc fDesc; | 302 Desc fDesc; |
| 293 const GrGLContext& fContext; | 303 const GrGLContext& fContext; |
| 294 | 304 |
| 295 GrGLUniformManager fUniformManager; | 305 GrGLUniformManager fUniformManager; |
| 296 UniformHandles fUniformHandles; | 306 UniformHandles fUniformHandles; |
| 297 | 307 |
| 298 typedef GrRefCnt INHERITED; | 308 typedef GrRefCnt INHERITED; |
| 299 }; | 309 }; |
| 300 | 310 |
| 301 #endif | 311 #endif |
| OLD | NEW |