diff options
author | Mike Klein <mtklein@chromium.org> | 2017-04-17 10:58:05 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-17 17:19:07 +0000 |
commit | b3821730e1ddd86b356fbf3247d115950c269240 (patch) | |
tree | a1c53864d1cdb23e12bc3e434f7c114ff3138676 /src/jumper/SkJumper_stages.cpp | |
parent | 62745a8bba20d7ca91167915eb459339bcfb8862 (diff) |
jumper, load_rgb_u16_be
testing: out/dm --src colorImage --colorImages images/colorspace/ --config srgb
Change-Id: I3481e1fb4a070cfd5d95361329fd95af5fcfbd1f
Reviewed-on: https://skia-review.googlesource.com/13590
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/jumper/SkJumper_stages.cpp')
-rw-r--r-- | src/jumper/SkJumper_stages.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/jumper/SkJumper_stages.cpp b/src/jumper/SkJumper_stages.cpp index 7c97235d2f..8ec63e2925 100644 --- a/src/jumper/SkJumper_stages.cpp +++ b/src/jumper/SkJumper_stages.cpp @@ -770,25 +770,36 @@ STAGE(store_f16) { } STAGE(load_u16_be) { - auto ptr = *(const uint64_t**)ctx + x; + auto ptr = *(const uint16_t**)ctx + 4*x; U16 R,G,B,A; - load4((const uint16_t*)ptr,tail, &R,&G,&B,&A); + load4(ptr,tail, &R,&G,&B,&A); r = C(1/65535.0f) * cast(expand(bswap(R))); g = C(1/65535.0f) * cast(expand(bswap(G))); b = C(1/65535.0f) * cast(expand(bswap(B))); a = C(1/65535.0f) * cast(expand(bswap(A))); } +STAGE(load_rgb_u16_be) { + auto ptr = *(const uint16_t**)ctx + 3*x; + + U16 R,G,B; + load3(ptr,tail, &R,&G,&B); + + r = C(1/65535.0f) * cast(expand(bswap(R))); + g = C(1/65535.0f) * cast(expand(bswap(G))); + b = C(1/65535.0f) * cast(expand(bswap(B))); + a = 1.0_f; +} STAGE(store_u16_be) { - auto ptr = *(uint64_t**)ctx + x; + auto ptr = *(uint16_t**)ctx + 4*x; U16 R = bswap(pack(round(r, 65535.0_f))), G = bswap(pack(round(g, 65535.0_f))), B = bswap(pack(round(b, 65535.0_f))), A = bswap(pack(round(a, 65535.0_f))); - store4((uint16_t*)ptr,tail, R,G,B,A); + store4(ptr,tail, R,G,B,A); } STAGE(load_f32) { |