static __m128i screen_modeproc_SSE2(const __m128i& src, const __m128i& dst) {
    __m128i a = srcover_byte_SSE2(SkGetPackedA32_SSE2(src),
                                  SkGetPackedA32_SSE2(dst));
    __m128i r = srcover_byte_SSE2(SkGetPackedR32_SSE2(src),
                                  SkGetPackedR32_SSE2(dst));
    __m128i g = srcover_byte_SSE2(SkGetPackedG32_SSE2(src),
                                  SkGetPackedG32_SSE2(dst));
    __m128i b = srcover_byte_SSE2(SkGetPackedB32_SSE2(src),
                                  SkGetPackedB32_SSE2(dst));
    return SkPackARGB32_SSE2(a, r, g, b);
}
Exemple #2
0
static __m128i overlay_modeproc_SSE2(const __m128i& src, const __m128i& dst) {
    __m128i sa = SkGetPackedA32_SSE2(src);
    __m128i da = SkGetPackedA32_SSE2(dst);

    __m128i a = srcover_byte_SSE2(sa, da);
    __m128i r = overlay_byte_SSE2(SkGetPackedR32_SSE2(src),
                                  SkGetPackedR32_SSE2(dst), sa, da);
    __m128i g = overlay_byte_SSE2(SkGetPackedG32_SSE2(src),
                                  SkGetPackedG32_SSE2(dst), sa, da);
    __m128i b = overlay_byte_SSE2(SkGetPackedB32_SSE2(src),
                                  SkGetPackedB32_SSE2(dst), sa, da);
    return SkPackARGB32_SSE2(a, r, g, b);
}
static __m128i multiply_modeproc_SSE2(const __m128i& src, const __m128i& dst) {
    __m128i sa = SkGetPackedA32_SSE2(src);
    __m128i da = SkGetPackedA32_SSE2(dst);
    __m128i a = srcover_byte_SSE2(sa, da);

    __m128i sr = SkGetPackedR32_SSE2(src);
    __m128i dr = SkGetPackedR32_SSE2(dst);
    __m128i r = blendfunc_multiply_byte_SSE2(sr, dr, sa, da);

    __m128i sg = SkGetPackedG32_SSE2(src);
    __m128i dg = SkGetPackedG32_SSE2(dst);
    __m128i g = blendfunc_multiply_byte_SSE2(sg, dg, sa, da);


    __m128i sb = SkGetPackedB32_SSE2(src);
    __m128i db = SkGetPackedB32_SSE2(dst);
    __m128i b = blendfunc_multiply_byte_SSE2(sb, db, sa, da);

    return SkPackARGB32_SSE2(a, r, g, b);
}