diff options
author | mtklein <mtklein@chromium.org> | 2016-01-08 11:45:21 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-08 11:45:21 -0800 |
commit | defa0daa6a0f4e97a3527a522ae602c6771a7c80 (patch) | |
tree | 1d47593806af59cc46dd58a40e99e3b27e2c55ad /src/opts/Sk4px_none.h | |
parent | 1a1efeacf7cc94a8c2977114dfe230fed3efc105 (diff) |
Clean up SkXfermode_opts.h
It seems that MSVC + __vectorcall don't play well together,
so back ourselves out into a situation where we don't need it.
- Inline transfermode functions. This removes the need for SK_VECTORCALL.
- Remove 565 destination specializations.
Blending into 565 is not speed-critical enough to merit the code bloat.
- Removing 565 specializations means a bunch of Sk4px code is now dead.
8888 xfermodes generally speed up a bit from inlining, smoothly ranging from no change down to 0.65x for the fastest functions like Plus or Modulate.
565 xfermodes generally slow down because we're doing 565 -> 8888 and 8888->565 conversion serially[1] and using the stack, smoothly ranging from no change up to 2x slower for the fastest functions like Plus and Modulate.
[1] the 565->8888 conversion is actually being autovectorized
BUG=skia:4765,skia:4776
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1565223002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
No public API changes.
TBR=reed@google.com
Review URL: https://codereview.chromium.org/1565223002
Diffstat (limited to 'src/opts/Sk4px_none.h')
-rw-r--r-- | src/opts/Sk4px_none.h | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/opts/Sk4px_none.h b/src/opts/Sk4px_none.h index efbd780c9f..b43ee875b2 100644 --- a/src/opts/Sk4px_none.h +++ b/src/opts/Sk4px_none.h @@ -106,35 +106,4 @@ inline Sk4px Sk4px::zeroColors() const { 0,0,0, this->kth<15>()); } -inline Sk4px Sk4px::Load4(const SkPMColor16 src[4]) { - SkPMColor src32[4]; - for (int i = 0; i < 4; i++) { src32[i] = SkPixel16ToPixel32(src[i]); } - return Load4(src32); -} -inline Sk4px Sk4px::Load2(const SkPMColor16 src[2]) { - SkPMColor src32[2]; - for (int i = 0; i < 2; i++) { src32[i] = SkPixel16ToPixel32(src[i]); } - return Load2(src32); -} -inline Sk4px Sk4px::Load1(const SkPMColor16 src[1]) { - SkPMColor src32 = SkPixel16ToPixel32(src[0]); - return Load1(&src32); -} - -inline void Sk4px::store4(SkPMColor16 dst[4]) const { - SkPMColor dst32[4]; - this->store4(dst32); - for (int i = 0; i < 4; i++) { dst[i] = SkPixel32ToPixel16(dst32[i]); } -} -inline void Sk4px::store2(SkPMColor16 dst[2]) const { - SkPMColor dst32[2]; - this->store2(dst32); - for (int i = 0; i < 2; i++) { dst[i] = SkPixel32ToPixel16(dst32[i]); } -} -inline void Sk4px::store1(SkPMColor16 dst[1]) const { - SkPMColor dst32; - this->store1(&dst32); - dst[0] = SkPixel32ToPixel16(dst32); -} - } // namespace |