diff options
author | 2016-07-13 08:02:20 -0700 | |
---|---|---|
committer | 2016-07-13 08:02:20 -0700 | |
commit | 0358a6ac00497ecb9fa9412045560b7f33d3a9eb (patch) | |
tree | 30f281a0afad4905da65c76b7c5aacf73bd04738 /src/opts/SkBlend_opts.h | |
parent | 9199a9fef9896636f673372d2ac1c00af036bf85 (diff) |
Update SkOpts namespaces.
If we make sure all SkOpts functions are static, we can give the namespaces any
name we like. This lets us drop the sk_ prefix and give a real indication of
the default SIMD instruction set rather than just saying sk_default.
Both of these changes help debugger, profiler, and crash report readability.
Perhaps more importantly, keeping these functions static helps prevent
accidentally linking in unused versions of functions, as you see here with
sk_avx::srcover_srgb_srgb().
This requires we update SkBlend_opts tests and benches to call SkOpts functions
through SkOpts rather than declaring the methods externally. In practice this
drops testing of the SSE2 version on machines with SSE4. If we still really
need to test/bench the compile time best SIMD level version of this method
against the runtime detected best, we can include SkBlend_opts.h into the tests
or benches directly, similar to what we do for the trivial, brute-force, or best
non-SIMD versions.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2145833002
CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review-Url: https://codereview.chromium.org/2145833002
Diffstat (limited to 'src/opts/SkBlend_opts.h')
-rw-r--r-- | src/opts/SkBlend_opts.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/opts/SkBlend_opts.h b/src/opts/SkBlend_opts.h index 39cbbe8d7e..4f6d1e9195 100644 --- a/src/opts/SkBlend_opts.h +++ b/src/opts/SkBlend_opts.h @@ -48,7 +48,7 @@ static inline void srcover_srgb_srgb_4(uint32_t* dst, const uint32_t* src) { #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41 - void srcover_srgb_srgb( + static void srcover_srgb_srgb( uint32_t* dst, const uint32_t* const srcStart, int ndst, const int nsrc) { const __m128i alphaMask = _mm_set1_epi32(0xFF000000); while (ndst > 0) { @@ -123,7 +123,7 @@ static inline void srcover_srgb_srgb_4(uint32_t* dst, const uint32_t* src) { return mask == 0; } - void srcover_srgb_srgb( + static void srcover_srgb_srgb( uint32_t* dst, const uint32_t* const srcStart, int ndst, const int nsrc) { while (ndst > 0) { int count = SkTMin(ndst, nsrc); @@ -166,7 +166,7 @@ static inline void srcover_srgb_srgb_4(uint32_t* dst, const uint32_t* src) { #endif #else - void srcover_srgb_srgb( + static void srcover_srgb_srgb( uint32_t* dst, const uint32_t* const src, int ndst, const int nsrc) { while (ndst > 0) { int n = SkTMin(ndst, nsrc); |