diff options
author | mtklein <mtklein@chromium.org> | 2015-08-07 08:48:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-07 08:48:12 -0700 |
commit | 3848427d884b72114854c8eef9662691f23fae7b (patch) | |
tree | 8f42991febfccb93d11e4a452cb5524ab74ad0e4 /include/core/SkColorPriv.h | |
parent | ca1f07eb5f976a39845721b434b780c5a705f3d9 (diff) |
The compiler can generate smulbb perfectly well nowadays.
BUG=skia:4117
Review URL: https://codereview.chromium.org/1273203002
Diffstat (limited to 'include/core/SkColorPriv.h')
-rw-r--r-- | include/core/SkColorPriv.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h index f9c5d928a0..3dec49b73e 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; } |