| 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 |
| 54 /** Called when the program stage should insert its code into the shaders. T
he code in each | 61 /** Called when the program stage should insert its code into the shaders. T
he code in each |
| 55 shader will be in its own block ({}) and so locally scoped names will no
t collide across | 62 shader will be in its own block ({}) and so locally scoped names will no
t collide across |
| 56 stages. | 63 stages. |
| 57 | 64 |
| 58 @param builder Interface used to emit code in the shaders. | 65 @param builder Interface used to emit code in the shaders. |
| 59 @param drawEffect A wrapper on the effect that generated this program
stage. | 66 @param drawEffect A wrapper on the effect that generated this program
stage. |
| 60 @param key The key that was computed by GenKey() from the gener
ating GrEffect. | 67 @param key The key that was computed by GenKey() from the gener
ating GrEffect. |
| 61 Only the bits indicated by GrBackendEffectFactory::k
EffectKeyBits are | 68 Only the bits indicated by GrBackendEffectFactory::k
EffectKeyBits are |
| 62 guaranteed to match the value produced by GenKey(); | 69 guaranteed to match the value produced by GenKey(); |
| 63 @param outputColor A predefined vec4 in the FS in which the stage shoul
d place its output | 70 @param outputColor A predefined vec4 in the FS in which the stage shoul
d place its output |
| (...skipping 26 matching lines...) Expand all Loading... |
| 90 const char* name() const { return fFactory.name(); } | 97 const char* name() const { return fFactory.name(); } |
| 91 | 98 |
| 92 static EffectKey GenTextureKey(const GrDrawEffect&, const GrGLCaps&); | 99 static EffectKey GenTextureKey(const GrDrawEffect&, const GrGLCaps&); |
| 93 static EffectKey GenAttribKey(const GrDrawEffect& stage); | 100 static EffectKey GenAttribKey(const GrDrawEffect& stage); |
| 94 | 101 |
| 95 protected: | 102 protected: |
| 96 const GrBackendEffectFactory& fFactory; | 103 const GrBackendEffectFactory& fFactory; |
| 97 }; | 104 }; |
| 98 | 105 |
| 99 #endif | 106 #endif |
| OLD | NEW |