author | Lee Salzman <lsalzman@mozilla.com> |
Wed, 18 Jan 2017 10:15:09 -0500 | |
changeset 329963 | 34ffa05e2af018ce65d69c49f9018cf2aa99438b |
parent 329962 | 20d71b8cba1558f8b55a3c07e8b4d5ea91b9288b |
child 329964 | 02057c9d45e530d17acd76769bdf53558747936b |
push id | 31228 |
push user | kwierso@gmail.com |
push date | Wed, 18 Jan 2017 22:17:25 +0000 |
treeherder | mozilla-central@96cb95af5304 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | vliu |
bugs | 1325259 |
milestone | 53.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/gfx/skia/skia/src/core/SkBlitMask_D32.cpp +++ b/gfx/skia/skia/src/core/SkBlitMask_D32.cpp @@ -139,46 +139,24 @@ static void A8_RowProc_Blend( const uint8_t* SK_RESTRICT mask = static_cast<const uint8_t*>(maskIn); for (int i = 0; i < count; ++i) { if (mask[i]) { dst[i] = SkBlendARGB32(src[i], dst[i], mask[i]); } } } -// expand the steps that SkAlphaMulQ performs, but this way we can -// exand.. add.. combine -// instead of -// expand..combine add expand..combine -// -#define EXPAND0(v, m, s) ((v) & (m)) * (s) -#define EXPAND1(v, m, s) (((v) >> 8) & (m)) * (s) -#define COMBINE(e0, e1, m) ((((e0) >> 8) & (m)) | ((e1) & ~(m))) - static void A8_RowProc_Opaque( SkPMColor* SK_RESTRICT dst, const void* maskIn, const SkPMColor* SK_RESTRICT src, int count) { const uint8_t* SK_RESTRICT mask = static_cast<const uint8_t*>(maskIn); for (int i = 0; i < count; ++i) { int m = mask[i]; if (m) { m += (m >> 7); -#if 1 - // this is slightly slower than the expand/combine version, but it - // is much closer to the old results, so we use it for now to reduce - // rebaselining. - dst[i] = SkAlphaMulQ(src[i], m) + SkAlphaMulQ(dst[i], 256 - m); -#else - uint32_t v = src[i]; - uint32_t s0 = EXPAND0(v, rbmask, m); - uint32_t s1 = EXPAND1(v, rbmask, m); - v = dst[i]; - uint32_t d0 = EXPAND0(v, rbmask, m); - uint32_t d1 = EXPAND1(v, rbmask, m); - dst[i] = COMBINE(s0 + d0, s1 + d1, rbmask); -#endif + dst[i] = SkPMLerp(src[i], dst[i], m); } } } static int upscale31To255(int value) { value = (value << 3) | (value >> 2); return value; }