Index: src/gpu/gl/GrGLEffect.cpp |
diff --git a/src/gpu/gl/GrGLEffect.cpp b/src/gpu/gl/GrGLEffect.cpp |
index 28be7afb345396188de0569646161590ee36b417..af351a47fe41f435ab5c9b57483dd5ad5ecaee6e 100644 |
--- a/src/gpu/gl/GrGLEffect.cpp |
+++ b/src/gpu/gl/GrGLEffect.cpp |
@@ -7,6 +7,7 @@ |
#include "GrGLSL.h" |
#include "GrGLEffect.h" |
+#include "GrCoordTransform.h" |
#include "GrDrawEffect.h" |
GrGLEffect::GrGLEffect(const GrBackendEffectFactory& factory) |
@@ -34,6 +35,18 @@ GrGLEffect::EffectKey GrGLEffect::GenTextureKey(const GrDrawEffect& drawEffect, |
return key; |
} |
+GrGLEffect::EffectKey GrGLEffect::GenTransformKey(const GrDrawEffect& drawEffect) { |
+ EffectKey key = 0; |
+ int numTransforms = (*drawEffect.effect())->numTransforms(); |
+ for (int index = 0; index < numTransforms; ++index) { |
+ EffectKey value = GrGLCoordTransform::GenKey(drawEffect, index); |
+ value <<= index * GrGLCoordTransform::kKeyBits; |
+ SkASSERT(0 == (value & key)); // keys for each transform ought not to overlap |
+ key |= value; |
+ } |
+ return key; |
+} |
+ |
GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrDrawEffect& drawEffect) { |
EffectKey key = 0; |