Add a hook for CPU-optimized sRGB-sRGB srcover.
Herb's really starting to get serious about tweaking this, which becomes
a lot easier when you've got SkOpts' runtime CPU detection. We should be
able to optimize this usefully for SSSE3, SSE4.1, AVX, AVX2, or NEON.
(We can of course implement a subset.)
This function takes two counts to give us flexibility to write src patterns:
nsrc >= ndst -> the usual srcover function
nsrc < ndst -> repeat src until it fills dst
nsrc << ndst -> possibly preprocess src into registers
nsrc == 1 -> equivalent of blitrow_color32, srcover_1, etc.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939783003
Review-Url: https://codereview.chromium.org/1939783003
diff --git a/src/core/SkOpts.h b/src/core/SkOpts.h
index 04c9f00..b8aea4a 100644
--- a/src/core/SkOpts.h
+++ b/src/core/SkOpts.h
@@ -64,6 +64,10 @@
extern void (*half_to_float)(float[], const uint16_t[], int);
extern void (*float_to_half)(uint16_t[], const float[], int);
+
+ // Blend ndst src pixels over dst, where both src and dst point to sRGB pixels (RGBA or BGRA).
+ // If nsrc < ndst, we loop over src to create a pattern.
+ extern void (*srcover_srgb_srgb)(uint32_t* dst, const uint32_t* src, int ndst, int nsrc);
}
#endif//SkOpts_DEFINED