From: mike@reedtribe.org Date: Sun, 12 Aug 2012 19:08:41 +0000 (+0000) Subject: revert arith change, until I can rebaseline all the images (and check chrome) X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~15226 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e330ae5f90ef8a4a864329b9a634644a05bf124;p=platform%2Fupstream%2FlibSkiaSharp.git revert arith change, until I can rebaseline all the images (and check chrome) git-svn-id: http://skia.googlecode.com/svn/trunk@5044 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp index cd3c31d..c999ce0 100644 --- a/src/effects/SkArithmeticMode.cpp +++ b/src/effects/SkArithmeticMode.cpp @@ -107,7 +107,14 @@ void SkArithmeticMode_scalar::xfer32(SkPMColor dst[], const SkPMColor src[], b = blend(b, SkGetPackedB32(sc), scale); } - dst[i] = SkPremultiplyARGBInline(a, r, g, b); + // turn the result back into premul + if (0xFF != a) { + int scale = a + (a >> 7); + r = SkAlphaMul(r, scale); + g = SkAlphaMul(g, scale); + b = SkAlphaMul(b, scale); + } + dst[i] = SkPackARGB32(a, r, g, b); } } }