Index: src/core/SkXfermodeU64.cpp |
diff --git a/src/core/SkXfermodeU64.cpp b/src/core/SkXfermodeU64.cpp |
index 630a9d068351f103f22a8d9ccb3770bd18a125eb..eaaa2656f0d2db1a00f71a9f6a7d61bc8caec64e 100644 |
--- a/src/core/SkXfermodeU64.cpp |
+++ b/src/core/SkXfermodeU64.cpp |
@@ -211,6 +211,20 @@ template <DstType D> void srcover_n(const SkXfermode*, uint64_t dst[], |
} |
} |
+template <> void srcover_n<kF16_Dst>(const SkXfermode*, uint64_t dst[], |
+ const SkPM4f src[], int count, const SkAlpha aa[]) { |
+ SkFloatConvert fc; |
+ for (int i = 0; i < count; ++i) { |
+ Sk4f s = Sk4f::Load(src+i), |
+ d = fc.halfToFloat(dst[i]), |
+ r = s + d * (1.0f - SkNx_shuffle<3,3,3,3>(s)); |
+ if (aa) { |
+ r = lerp_by_coverage(r, d, aa[i]); |
+ } |
+ dst[i] = fc.floatToHalf(r); |
+ } |
+} |
+ |
const SkXfermode::D64Proc gProcs_SrcOver[] = { |
srcover_n<kU16_Dst>, src_n<kU16_Dst>, |
srcover_1<kU16_Dst>, src_1<kU16_Dst>, |