Chromium Code Reviews| Index: src/gpu/gl/GrGLEffect.h |
| diff --git a/src/gpu/gl/GrGLEffect.h b/src/gpu/gl/GrGLEffect.h |
| index 5df22811c4c60dfef25794d2294ad49117a60a05..d3c49d11cf76d4af80ef19cd01764e910a53df68 100644 |
| --- a/src/gpu/gl/GrGLEffect.h |
| +++ b/src/gpu/gl/GrGLEffect.h |
| @@ -18,8 +18,8 @@ class GrGLTexture; |
| /** @file |
| This file contains specializations for OpenGL of the shader stages declared in |
| include/gpu/GrEffect.h. Objects of type GrGLEffect are responsible for emitting the |
| - GLSL code that implements a GrEffect and for uploading uniforms at draw time. They also |
| - must have a function: |
| + GLSL code that implements a GrEffect and for uploading uniforms at draw time. If they don't |
| + always emit the same GLSL code, they must have a function: |
| static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&) |
| that is used to implement a program cache. When two GrEffects produce the same key this means |
| that their GrGLEffects would emit the same GLSL code. |
| @@ -45,6 +45,7 @@ public: |
| kEffectKeyBits = GrBackendEffectFactory::kEffectKeyBits, |
| }; |
| + typedef GrGLShaderBuilder::TransformedCoordsArray TransformedCoordsArray; |
| typedef GrGLShaderBuilder::TextureSamplerArray TextureSamplerArray; |
| GrGLEffect(const GrBackendEffectFactory&); |
| @@ -76,6 +77,7 @@ public: |
| EffectKey key, |
| const char* outputColor, |
| const char* inputColor, |
| + const TransformedCoordsArray& coords, |
| const TextureSamplerArray& samplers) = 0; |
| /** A GrGLEffect instance can be reused with any GrEffect that produces the same stage |
| @@ -89,7 +91,10 @@ public: |
| const char* name() const { return fFactory.name(); } |
| + static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&) { return 0; } |
|
bsalomon
2013/09/27 20:04:25
does this get called?
Chris Dalton
2013/09/27 23:33:45
Yeah. A lot of effects don't need to make their ow
bsalomon
2013/09/30 13:24:41
Oh wow. I don't think I ever seen this pattern of
|
| + |
| static EffectKey GenTextureKey(const GrDrawEffect&, const GrGLCaps&); |
| + static EffectKey GenTransformKey(const GrDrawEffect&); |
| static EffectKey GenAttribKey(const GrDrawEffect& stage); |
| protected: |