| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 GrGLShaderBuilder(GrGpuGL*, GrGLUniformManager&, const GrGLProgramDesc&); | 44 GrGLShaderBuilder(GrGpuGL*, GrGLUniformManager&, const GrGLProgramDesc&); |
| 45 virtual ~GrGLShaderBuilder() {} | 45 virtual ~GrGLShaderBuilder() {} |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Use of these features may require a GLSL extension to be enabled. Shaders
may not compile | 48 * Use of these features may require a GLSL extension to be enabled. Shaders
may not compile |
| 49 * if code is added that uses one of these features without calling enableFe
ature() | 49 * if code is added that uses one of these features without calling enableFe
ature() |
| 50 */ | 50 */ |
| 51 enum GLSLFeature { | 51 enum GLSLFeature { |
| 52 kStandardDerivatives_GLSLFeature = 0, | 52 kStandardDerivatives_GLSLFeature = 0, |
| 53 kTexCoordSupport_GLSLFeature, |
| 53 | 54 |
| 54 kLastGLSLFeature = kStandardDerivatives_GLSLFeature | 55 kLastGLSLFeature = kTexCoordSupport_GLSLFeature |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 /** | 58 /** |
| 58 * If the feature is supported then true is returned and any necessary #exte
nsion declarations | 59 * If the feature is supported then true is returned and any necessary #exte
nsion declarations |
| 59 * are added to the shaders. If the feature is not supported then false will
be returned. | 60 * are added to the shaders. If the feature is not supported then false will
be returned. |
| 60 */ | 61 */ |
| 61 bool enableFeature(GLSLFeature); | 62 bool enableFeature(GLSLFeature); |
| 62 | 63 |
| 63 /** | 64 /** |
| 64 * Called by GrGLEffects to add code the fragment shader. | 65 * Called by GrGLEffects to add code the fragment shader. |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 GrGLFragmentOnlyShaderBuilder(GrGpuGL*, GrGLUniformManager&, const GrGLProgr
amDesc&); | 459 GrGLFragmentOnlyShaderBuilder(GrGpuGL*, GrGLUniformManager&, const GrGLProgr
amDesc&); |
| 459 | 460 |
| 460 int getNumTexCoordSets() const { return fNumTexCoordSets; } | 461 int getNumTexCoordSets() const { return fNumTexCoordSets; } |
| 461 int addTexCoordSets(int count); | 462 int addTexCoordSets(int count); |
| 462 | 463 |
| 463 virtual GrGLProgramEffects* createAndEmitEffects( | 464 virtual GrGLProgramEffects* createAndEmitEffects( |
| 464 const GrEffectStage* effectStages[], | 465 const GrEffectStage* effectStages[], |
| 465 const EffectKey effectKeys[], | 466 const EffectKey effectKeys[], |
| 466 int effectCnt, | 467 int effectCnt, |
| 467 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; | 468 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; |
| 469 protected: |
| 470 virtual bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>
* shaderIds) const SK_OVERRIDE; |
| 468 | 471 |
| 469 private: | 472 private: |
| 470 int fNumTexCoordSets; | 473 int fNumTexCoordSets; |
| 471 | 474 |
| 472 typedef GrGLShaderBuilder INHERITED; | 475 typedef GrGLShaderBuilder INHERITED; |
| 473 }; | 476 }; |
| 474 | 477 |
| 475 #endif | 478 #endif |
| OLD | NEW |