OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #ifndef GrGLShaderBuilder_DEFINED | 8 #ifndef GrGLShaderBuilder_DEFINED |
9 #define GrGLShaderBuilder_DEFINED | 9 #define GrGLShaderBuilder_DEFINED |
10 | 10 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 */ | 252 */ |
253 const GrGLShaderVar& positionAttribute() const { return *fPositionVar; } | 253 const GrGLShaderVar& positionAttribute() const { return *fPositionVar; } |
254 | 254 |
255 /** Returns a vertex attribute that represents the local coords in the VS. T
his may be the same | 255 /** Returns a vertex attribute that represents the local coords in the VS. T
his may be the same |
256 as positionAttribute() or it may not be. It depends upon whether the ren
dering code | 256 as positionAttribute() or it may not be. It depends upon whether the ren
dering code |
257 specified explicit local coords or not in the GrDrawState. */ | 257 specified explicit local coords or not in the GrDrawState. */ |
258 const GrGLShaderVar& localCoordsAttribute() const { return *fLocalCoordsVar;
} | 258 const GrGLShaderVar& localCoordsAttribute() const { return *fLocalCoordsVar;
} |
259 | 259 |
260 /** Returns the color of the destination pixel. This may be NULL if no effec
t advertised | 260 /** Returns the color of the destination pixel. This may be NULL if no effec
t advertised |
261 that it will read the destination. */ | 261 that it will read the destination. */ |
262 const char* dstColor() const; | 262 const char* dstColor(); |
263 | 263 |
264 /** | 264 /** |
265 * Are explicit local coordinates provided as input to the vertex shader. | 265 * Are explicit local coordinates provided as input to the vertex shader. |
266 */ | 266 */ |
267 bool hasExplicitLocalCoords() const { return (fLocalCoordsVar != fPositionVa
r); } | 267 bool hasExplicitLocalCoords() const { return (fLocalCoordsVar != fPositionVa
r); } |
268 | 268 |
269 /** | 269 /** |
270 * Interfaces used by GrGLProgram. | 270 * Interfaces used by GrGLProgram. |
271 * TODO: Hide these from the GrEffects using friend or splitting this into t
wo related classes. | 271 * TODO: Hide these from the GrEffects using friend or splitting this into t
wo related classes. |
272 * Also, GrGLProgram's shader string construction should be moved to this cl
ass. | 272 * Also, GrGLProgram's shader string construction should be moved to this cl
ass. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 private: | 340 private: |
341 enum { | 341 enum { |
342 kNonStageIdx = -1, | 342 kNonStageIdx = -1, |
343 }; | 343 }; |
344 | 344 |
345 /** | 345 /** |
346 * Features that should only be enabled by GrGLShaderBuilder itself. | 346 * Features that should only be enabled by GrGLShaderBuilder itself. |
347 */ | 347 */ |
348 enum GLSLPrivateFeature { | 348 enum GLSLPrivateFeature { |
349 kFragCoordConventions_GLSLPrivateFeature = kLastGLSLFeature + 1 | 349 kFragCoordConventions_GLSLPrivateFeature = kLastGLSLFeature + 1, |
| 350 kEXTShaderFramebufferFetch_GLSLPrivateFeature, |
| 351 kNVShaderFramebufferFetch_GLSLPrivateFeature, |
350 }; | 352 }; |
351 bool enablePrivateFeature(GLSLPrivateFeature); | 353 bool enablePrivateFeature(GLSLPrivateFeature); |
352 | 354 |
353 // If we ever have VS/GS features we can expand this to take a bitmask of Sh
aderType and track | 355 // If we ever have VS/GS features we can expand this to take a bitmask of Sh
aderType and track |
354 // the enables separately for each shader. | 356 // the enables separately for each shader. |
355 void addFSFeature(uint32_t featureBit, const char* extensionName); | 357 void addFSFeature(uint32_t featureBit, const char* extensionName); |
356 | 358 |
357 // Interpretation of DstReadKey when generating code | 359 // Interpretation of DstReadKey when generating code |
358 enum { | 360 enum { |
359 kNoDstRead_DstReadKey = 0, | 361 kNoDstRead_DstReadKey = 0, |
(...skipping 23 matching lines...) Expand all Loading... |
383 GrGLUniformManager::UniformHandle fDstCopyScaleUniform; | 385 GrGLUniformManager::UniformHandle fDstCopyScaleUniform; |
384 | 386 |
385 SkSTArray<10, AttributePair, true> fEffectAttributes; | 387 SkSTArray<10, AttributePair, true> fEffectAttributes; |
386 | 388 |
387 GrGLShaderVar* fPositionVar; | 389 GrGLShaderVar* fPositionVar; |
388 GrGLShaderVar* fLocalCoordsVar; | 390 GrGLShaderVar* fLocalCoordsVar; |
389 | 391 |
390 }; | 392 }; |
391 | 393 |
392 #endif | 394 #endif |
OLD | NEW |