Fix EffectKey for XferEffect
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 7 Apr 2014 17:13:10 +0000 (17:13 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 7 Apr 2014 17:13:10 +0000 (17:13 +0000)
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/227233007

git-svn-id: http://skia.googlecode.com/svn/trunk@14076 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkXfermode.cpp

index 674078e..78b85da 100644 (file)
@@ -1079,7 +1079,10 @@ public:
         }
 
         static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&) {
-            return drawEffect.castEffect<XferEffect>().mode();
+            // The background may come from the dst or from a texture.
+            int numTextures = (*drawEffect.effect())->numTextures();
+            SkASSERT(numTextures <= 1);
+            return (drawEffect.castEffect<XferEffect>().mode() << 1) | numTextures;
         }
 
     private: