oops, forgot tests only run in Android roll

Looks like we can't just drop SK_SUPPORT_LEGACY_A8_MASKBLITTER so easy.

Change-Id: I45f8a8efd75ba4e0d5bc5cb1972296f88a447db8
Reviewed-on: https://skia-review.googlesource.com/c/170271
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2018-11-09 15:59:05 -05:00 committed by Skia Commit-Bot
parent 303a38c860
commit 0b473fb83b

View File

@ -1150,18 +1150,35 @@ void SkARGB32_Shader_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[],
static void blend_row_A8(SkPMColor* dst, const void* vmask, const SkPMColor* src, int n) {
auto mask = (const uint8_t*)vmask;
#ifdef SK_SUPPORT_LEGACY_A8_MASKBLITTER
for (int i = 0; i < n; ++i) {
if (mask[i]) {
dst[i] = SkBlendARGB32(src[i], dst[i], mask[i]);
}
}
#else
Sk4px::MapDstSrcAlpha(n, dst, src, mask, [](const Sk4px& d, const Sk4px& s, const Sk4px& aa) {
const auto s_aa = s.approxMulDiv255(aa);
return s_aa + d.approxMulDiv255(s_aa.alphas().inv());
});
#endif
}
static void blend_row_A8_opaque(SkPMColor* dst, const void* vmask, const SkPMColor* src, int n) {
auto mask = (const uint8_t*)vmask;
#ifdef SK_SUPPORT_LEGACY_A8_MASKBLITTER
for (int i = 0; i < n; ++i) {
if (int m = mask[i]) {
m += (m >> 7);
dst[i] = SkAlphaMulQ(src[i], m) + SkAlphaMulQ(dst[i], 256 - m);
}
}
#else
Sk4px::MapDstSrcAlpha(n, dst, src, mask, [](const Sk4px& d, const Sk4px& s, const Sk4px& aa) {
return (s * aa + d * aa.inv()).div255();
});
#endif
}
static void blend_row_lcd16(SkPMColor* dst, const void* vmask, const SkPMColor* src, int n) {