Add missing fallback blending to SkA8_Shader_Blitter::blitMask()
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Aug 2013 18:16:07 +0000 (18:16 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Aug 2013 18:16:07 +0000 (18:16 +0000)
Similarly to SkA8_Shader_Blitter::blitAntiH() and SkA8_Shader_Blitter::blitH(), blitMask() should handle a missing SkXfermode gracefully.

R=reed@google.com

Author: fmalita@chromium.org

Review URL: https://chromiumcodereview.appspot.com/22867008

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

src/core/SkBlitter_A8.cpp

index 0255464..7fca29e 100644 (file)
@@ -336,6 +336,10 @@ void SkA8_Shader_Blitter::blitMask(const SkMask& mask, const SkIRect& clip) {
         fShader->shadeSpan(x, y, span, width);
         if (fXfermode) {
             fXfermode->xferA8(device, span, width, alpha);
+        } else {
+            for (int i = width - 1; i >= 0; --i) {
+                device[i] = aa_blend8(span[i], device[i], alpha[i]);
+            }
         }
 
         y += 1;