diff options
author | mtklein <mtklein@chromium.org> | 2016-07-20 18:10:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-20 18:10:07 -0700 |
commit | 0c902473d64ef935a64d078f70bdc9334ab51427 (patch) | |
tree | 09a423ffe65a60d3571372d455df64068ac754a7 /src/core/SkSpanProcs.cpp | |
parent | 456bf30d321292da7f15d1af35fd94fbb6a4bb59 (diff) |
Correct sRGB <-> linear everywhere.
This trims the SkPM4fPriv methods down to just foolproof methods.
(Anything trying to build these itself is probably wrong.)
Things like Sk4f srgb_to_linear(Sk4f) can't really exist anymore,
at least not efficiently, so this refactor is somewhat more invasive
than you might think. Generally this means things using to_4f() are
also making a misstep... that's gone too.
It also does not make sense to try to play games with linear floats
with 255 bias any more. That hack can't work with real sRGB coding.
Rather than update them, I've removed a couple of L32 xfermode fast
paths. I'd even rather drop it entirely...
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2163683002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review-Url: https://codereview.chromium.org/2163683002
Diffstat (limited to 'src/core/SkSpanProcs.cpp')
-rw-r--r-- | src/core/SkSpanProcs.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/SkSpanProcs.cpp b/src/core/SkSpanProcs.cpp index 87dcbc0ee7..b2e9914a17 100644 --- a/src/core/SkSpanProcs.cpp +++ b/src/core/SkSpanProcs.cpp @@ -22,7 +22,7 @@ static void load_l32(const SkPixmap& src, int x, int y, SkPM4f span[], int count SkASSERT(src.addr32(x + count - 1, y)); for (int i = 0; i < count; ++i) { - (to_4f_rgba(addr[i]) * Sk4f(1.0f/255)).store(span[i].fVec); + swizzle_rb_if_bgra(Sk4f_fromL32(addr[i])).store(span[i].fVec); } } @@ -32,7 +32,7 @@ static void load_s32(const SkPixmap& src, int x, int y, SkPM4f span[], int count SkASSERT(src.addr32(x + count - 1, y)); for (int i = 0; i < count; ++i) { - srgb_to_linear(to_4f_rgba(addr[i]) * Sk4f(1.0f/255)).store(span[i].fVec); + swizzle_rb_if_bgra(Sk4f_fromS32(addr[i])).store(span[i].fVec); } } |