| 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 GrGLEffect_DEFINED | 8 #ifndef GrGLEffect_DEFINED |
| 9 #define GrGLEffect_DEFINED | 9 #define GrGLEffect_DEFINED |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // the number of bits in EffectKey available to GenKey | 44 // the number of bits in EffectKey available to GenKey |
| 45 kEffectKeyBits = GrBackendEffectFactory::kEffectKeyBits, | 45 kEffectKeyBits = GrBackendEffectFactory::kEffectKeyBits, |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 typedef GrGLShaderBuilder::TextureSamplerArray TextureSamplerArray; | 48 typedef GrGLShaderBuilder::TextureSamplerArray TextureSamplerArray; |
| 49 | 49 |
| 50 GrGLEffect(const GrBackendEffectFactory&); | 50 GrGLEffect(const GrBackendEffectFactory&); |
| 51 | 51 |
| 52 virtual ~GrGLEffect(); | 52 virtual ~GrGLEffect(); |
| 53 | 53 |
| 54 /** Called when GrGLProgram is about to create its GrGLShaderBuilder. When p
ossible, effects | |
| 55 should handle programs that don't have a vertex shader. But if an effect
requires special | |
| 56 vertex processing that can't be accomplished with the fixed pipeline, it
can override this | |
| 57 method and return true to guarantee the GrGLShaderBuilder in emitCode ha
s a VertexBuilder. | |
| 58 */ | |
| 59 virtual bool requiresVertexShader(const GrDrawEffect&) const { return false;
} | |
| 60 | |
| 61 /** Called when the program stage should insert its code into the shaders. T
he code in each | 54 /** Called when the program stage should insert its code into the shaders. T
he code in each |
| 62 shader will be in its own block ({}) and so locally scoped names will no
t collide across | 55 shader will be in its own block ({}) and so locally scoped names will no
t collide across |
| 63 stages. | 56 stages. |
| 64 | 57 |
| 65 @param builder Interface used to emit code in the shaders. | 58 @param builder Interface used to emit code in the shaders. |
| 66 @param drawEffect A wrapper on the effect that generated this program
stage. | 59 @param drawEffect A wrapper on the effect that generated this program
stage. |
| 67 @param key The key that was computed by GenKey() from the gener
ating GrEffect. | 60 @param key The key that was computed by GenKey() from the gener
ating GrEffect. |
| 68 Only the bits indicated by GrBackendEffectFactory::k
EffectKeyBits are | 61 Only the bits indicated by GrBackendEffectFactory::k
EffectKeyBits are |
| 69 guaranteed to match the value produced by GenKey(); | 62 guaranteed to match the value produced by GenKey(); |
| 70 @param outputColor A predefined vec4 in the FS in which the stage shoul
d place its output | 63 @param outputColor A predefined vec4 in the FS in which the stage shoul
d place its output |
| (...skipping 26 matching lines...) Expand all Loading... |
| 97 const char* name() const { return fFactory.name(); } | 90 const char* name() const { return fFactory.name(); } |
| 98 | 91 |
| 99 static EffectKey GenTextureKey(const GrDrawEffect&, const GrGLCaps&); | 92 static EffectKey GenTextureKey(const GrDrawEffect&, const GrGLCaps&); |
| 100 static EffectKey GenAttribKey(const GrDrawEffect& stage); | 93 static EffectKey GenAttribKey(const GrDrawEffect& stage); |
| 101 | 94 |
| 102 protected: | 95 protected: |
| 103 const GrBackendEffectFactory& fFactory; | 96 const GrBackendEffectFactory& fFactory; |
| 104 }; | 97 }; |
| 105 | 98 |
| 106 #endif | 99 #endif |
| OLD | NEW |