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 02554643d26e4380e7760b0e6a0f62b2468c2244..7fca29ecf5d0c2e31c12b0fe9b01bdceba74d8e6 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;