aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkNx.h
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-01-19 12:04:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-19 22:08:52 +0000
commit5bee0b6de6b3ad1166d067e6b5046b48b8240a29 (patch)
treed9412f11227a45b46741059b74d38dc72bf89269 /src/core/SkNx.h
parentf720098671b7f28cc7cda4831c2b41e5d7e4a5bb (diff)
Reland "Respect full precision for RGB16 PNGs" (part 2)
This lands all the new xform hooks but no change to src/codec. So the new decode features are turned off. I'm relanding this in pieces to try to bisect a strange MSAN error. Original CL: https://skia-review.googlesource.com/c/7085/ BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD,Build-Ubuntu-Clang-x86_64-Release-Fast Change-Id: I451a2a29c73ca475e9e7a5ded58d4948d6b8be19 Reviewed-on: https://skia-review.googlesource.com/7277 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/core/SkNx.h')
-rw-r--r--src/core/SkNx.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/SkNx.h b/src/core/SkNx.h
index a75495cd2a..5df575342c 100644
--- a/src/core/SkNx.h
+++ b/src/core/SkNx.h
@@ -68,6 +68,16 @@ struct SkNx {
*c = SkNx{cl, ch};
*d = SkNx{dl, dh};
}
+ AI static void Load3(const void* vptr, SkNx* a, SkNx* b, SkNx* c) {
+ auto ptr = (const char*)vptr;
+ Half al, bl, cl,
+ ah, bh, ch;
+ Half::Load3(ptr , &al, &bl, &cl);
+ Half::Load3(ptr + 3*N/2*sizeof(T), &ah, &bh, &ch);
+ *a = SkNx{al, ah};
+ *b = SkNx{bl, bh};
+ *c = SkNx{cl, ch};
+ }
AI static void Store4(void* vptr, const SkNx& a, const SkNx& b, const SkNx& c, const SkNx& d) {
auto ptr = (char*)vptr;
Half::Store4(ptr, a.fLo, b.fLo, c.fLo, d.fLo);
@@ -149,6 +159,12 @@ struct SkNx<1,T> {
*c = Load(ptr + 2*sizeof(T));
*d = Load(ptr + 3*sizeof(T));
}
+ AI static void Load3(const void* vptr, SkNx* a, SkNx* b, SkNx* c) {
+ auto ptr = (const char*)vptr;
+ *a = Load(ptr + 0*sizeof(T));
+ *b = Load(ptr + 1*sizeof(T));
+ *c = Load(ptr + 2*sizeof(T));
+ }
AI static void Store4(void* vptr, const SkNx& a, const SkNx& b, const SkNx& c, const SkNx& d) {
auto ptr = (char*)vptr;
a.store(ptr + 0*sizeof(T));