Refactor swizzle names and types.
- Plant a flag to say "pretend all the inputs are RGBA".
This is how libpng thinks.
This is the opposite of what the implementation had been doing,
so I've rearranged everything to reflect the new orientation.
- Rewrite the names to be less mysterious looking. No more Xs.
- Make the src type uniformly const void*, to allow for 888 (RGB) srcs.
This should be performance and pixel neutral. (Please revert if it's not.)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1626463002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review URL: https://codereview.chromium.org/1626463002
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index 24cb65f..f84b83e 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -333,7 +333,7 @@
// These swizzles trust that the alpha value is already 0xFF.
#ifdef SK_PMCOLOR_IS_RGBA
- SkOpts::swaprb_xxxa((uint32_t*) dst, (const uint32_t*) (src + offset), width);
+ SkOpts::RGBA_to_BGRA((uint32_t*) dst, src + offset, width);
#else
memcpy(dst, src + offset, width * bpp);
#endif
@@ -361,9 +361,9 @@
SkASSERT(deltaSrc == bpp);
#ifdef SK_PMCOLOR_IS_RGBA
- SkOpts::premul_swaprb_xxxa((uint32_t*) dst, (const uint32_t*) (src + offset), width);
+ SkOpts::RGBA_to_bgrA((uint32_t*) dst, src + offset, width);
#else
- SkOpts::premul_xxxa((uint32_t*) dst, (const uint32_t*) (src + offset), width);
+ SkOpts::RGBA_to_rgbA((uint32_t*) dst, src + offset, width);
#endif
}
@@ -419,9 +419,9 @@
SkASSERT(deltaSrc == bpp);
#ifdef SK_PMCOLOR_IS_RGBA
- SkOpts::premul_xxxa((uint32_t*) dst, (const uint32_t*) (src + offset), width);
+ SkOpts::RGBA_to_rgbA((uint32_t*) dst, src + offset, width);
#else
- SkOpts::premul_swaprb_xxxa((uint32_t*) dst, (const uint32_t*) (src + offset), width);
+ SkOpts::RGBA_to_bgrA((uint32_t*) dst, src + offset, width);
#endif
}
@@ -450,7 +450,7 @@
#ifdef SK_PMCOLOR_IS_RGBA
memcpy(dst, src + offset, width * bpp);
#else
- SkOpts::swaprb_xxxa((uint32_t*) dst, (const uint32_t*) (src + offset), width);
+ SkOpts::RGBA_to_BGRA((uint32_t*) dst, src + offset, width);
#endif
}