Chromium Code Reviews| Index: src/gpu/gl/GrGLProgramEffects.cpp |
| diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp |
| index 65d14fde116dc65f29f20ab426048583aa326ba1..436ff89e9822f8b7d6ae4a0d41687cf73600ea5d 100644 |
| --- a/src/gpu/gl/GrGLProgramEffects.cpp |
| +++ b/src/gpu/gl/GrGLProgramEffects.cpp |
| @@ -114,6 +114,27 @@ SkMatrix get_transform_matrix(const GrDrawEffect& drawEffect, int transformIdx) |
| //////////////////////////////////////////////////////////////////////////////// |
| +bool GrGLProgramEffects::GenEffectMetaKey(const GrDrawEffect& drawEffect, const GrGLCaps& caps, |
| + GrEffectKeyBuilder* b) { |
| + |
| + EffectKey textureKey = GrGLProgramEffects::GenTextureKey(drawEffect, caps); |
| + EffectKey transformKey = GrGLProgramEffects::GenTransformKey(drawEffect); |
| + EffectKey attribKey = GrGLProgramEffects::GenAttribKey(drawEffect); |
| + uint32_t classID = drawEffect.effect()->getFactory().effectClassID(); |
| + |
|
robertphillips
2014/07/11 17:24:58
Currently ?
bsalomon
2014/07/11 17:52:56
Done.
|
| + // Currenlty we allow 16 bits for each of the above portions of the meta-key. Fail if they |
| + // don't fit. |
| + static const uint32_t kMetaKeyInvalidMask = ~((uint32_t) SK_MaxU16); |
| + if ((textureKey | transformKey | attribKey | classID) & kMetaKeyInvalidMask) { |
| + return false; |
| + } |
| + |
| + uint32_t* key = b->add32n(2); |
| + key[0] = (textureKey << 16 | transformKey); |
| + key[1] = (classID << 16 | attribKey); |
| + return true; |
| +} |
| + |
| EffectKey GrGLProgramEffects::GenAttribKey(const GrDrawEffect& drawEffect) { |
| EffectKey key = 0; |
| int numAttributes = drawEffect.getVertexAttribIndexCount(); |