Index: include/core/SkColorPriv.h |
diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h |
index f9c5d928a0b06b842741ca112fe395f269a6ca40..3dec49b73e06846f21d13e43cb2082af9e345244 100644 |
--- a/include/core/SkColorPriv.h |
+++ b/include/core/SkColorPriv.h |
@@ -193,7 +193,7 @@ static inline unsigned Sk255To256(U8CPU value) { |
/** Multiplify value by 0..256, and shift the result down 8 |
(i.e. return (value * alpha256) >> 8) |
*/ |
-#define SkAlphaMul(value, alpha256) (SkMulS16(value, alpha256) >> 8) |
+#define SkAlphaMul(value, alpha256) (((value) * (alpha256)) >> 8) |
// The caller may want negative values, so keep all params signed (int) |
// so we don't accidentally slip into unsigned math and lose the sign |
@@ -213,7 +213,7 @@ static inline int SkAlphaBlend255(S16CPU src, S16CPU dst, U8CPU alpha) { |
SkASSERT((int16_t)dst == dst); |
SkASSERT((uint8_t)alpha == alpha); |
- int prod = SkMulS16(src - dst, alpha) + 128; |
+ int prod = (src - dst) * alpha + 128; |
prod = (prod + (prod >> 8)) >> 8; |
return dst + prod; |
} |