Chromium Code Reviews| Index: include/gpu/GrBackendEffectFactory.h |
| diff --git a/include/gpu/GrBackendEffectFactory.h b/include/gpu/GrBackendEffectFactory.h |
| index 77cf2cc13d4c05fd307c528a9aa124261996a5b0..48efa290f58e372f90a3e04ea5b3922fc5483742 100644 |
| --- a/include/gpu/GrBackendEffectFactory.h |
| +++ b/include/gpu/GrBackendEffectFactory.h |
| @@ -33,15 +33,15 @@ public: |
| typedef uint32_t EffectKey; |
| enum { |
| kNoEffectKey = 0, |
| - kEffectKeyBits = 15, |
| + kEffectKeyBits = 10, |
| /** |
| - * Some aspects of the generated code may be determined by the particular textures that are |
| - * associated with the effect. These manipulations are performed by GrGLShaderBuilder beyond |
| - * GrGLEffects' control. So there is a dedicated part of the key which is combined |
| - * automatically with the bits produced by GrGLEffect::GenKey(). |
| + * The framework automatically includes coord transfors and texture accesses in their |
|
jvanverth1
2013/09/27 20:41:35
Typo: transfors
Chris Dalton
2013/09/27 23:33:45
Done.
|
| + * effect's EffectKey, so effects don't need to account for them in GenKey(). |
| */ |
| - kTextureKeyBits = 6, |
| - kAttribKeyBits = 6 |
| + kTextureKeyBits = 5, |
| + kTransformKeyBits = 6, |
| + kAttribKeyBits = 6, |
| + kClassIDBits = 5 |
| }; |
| virtual EffectKey glEffectKey(const GrDrawEffect&, const GrGLCaps&) const = 0; |
| @@ -56,6 +56,10 @@ public: |
| virtual const char* name() const = 0; |
| + static EffectKey GetTransformKey(EffectKey key) { |
| + return key >> (kEffectKeyBits + kTextureKeyBits) & ((1U << kTransformKeyBits) - 1); |
| + } |
| + |
| protected: |
| enum { |
| kIllegalEffectClassID = 0, |