Index: src/core/SkXfermodeF16.cpp |
diff --git a/src/core/SkXfermodeF16.cpp b/src/core/SkXfermodeF16.cpp |
index 2c6873f764e748092c40a0b09f82dc1409547a00..dfcefa2de5ba4df925b4b7b0f5df349b5722a0bf 100644 |
--- a/src/core/SkXfermodeF16.cpp |
+++ b/src/core/SkXfermodeF16.cpp |
@@ -134,13 +134,15 @@ |
static void srcover_n(const SkXfermode*, uint64_t dst[], const SkPM4f src[], int count, |
const SkAlpha aa[]) { |
for (int i = 0; i < count; ++i) { |
- Sk4f s = Sk4f::Load(src+i), |
- d = SkHalfToFloat_01(dst+i), |
- r = s + d*(1.0f - SkNx_shuffle<3,3,3,3>(s)); |
+ const Sk4f s4 = Sk4f::Load(src[i].fVec); |
+ const Sk4f dst_scale = Sk4f(1 - get_alpha(s4)); |
+ const Sk4f d4 = SkHalfToFloat_01(dst[i]); |
+ const Sk4f r4 = s4 + d4 * dst_scale; |
if (aa) { |
- r = lerp_by_coverage(r, d, aa[i]); |
+ dst[i] = SkFloatToHalf_01(lerp_by_coverage(r4, d4, aa[i])); |
+ } else { |
+ dst[i] = SkFloatToHalf_01(r4); |
} |
- SkFloatToHalf_01(r, dst+i); |
} |
} |