diff options
author | skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com> | 2018-06-21 18:47:13 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-21 19:18:57 +0000 |
commit | 09f92b94f55abcee37535da72e5bf7a51fa515d8 (patch) | |
tree | fcfad4a46e7456dfcebc7a1e67ce7871bf2f740d /third_party/skcms/src/Transform_inl.h | |
parent | f2e4a039df33d9246bd0ec68602d4d06e6199553 (diff) |
Roll skia/third_party/skcms 78ef7c5c81fb..97bcdb1d73a1 (1 commits)
https://skia.googlesource.com/skcms.git/+log/78ef7c5c81fb..97bcdb1d73a1
2018-06-21 brianosman@google.com Add support for Alpha8, Gray8, and 4444 pixel formats
The AutoRoll server is located here: https://skcms-skia-roll.skia.org
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
TBR=kjlubick@google.com
Change-Id: I0f7ec97e88bd17fbee65c825c60da2044dfece8c
Reviewed-on: https://skia-review.googlesource.com/136665
Commit-Queue: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Reviewed-by: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Diffstat (limited to 'third_party/skcms/src/Transform_inl.h')
-rw-r--r-- | third_party/skcms/src/Transform_inl.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/third_party/skcms/src/Transform_inl.h b/third_party/skcms/src/Transform_inl.h index 224412bfa4..fd3100aa60 100644 --- a/third_party/skcms/src/Transform_inl.h +++ b/third_party/skcms/src/Transform_inl.h @@ -576,6 +576,28 @@ static void NS(exec_ops)(const Op* ops, const void** args, switch (profile_next_op(*ops++)) { case Op_noop: break; + case Op_load_a8:{ + U8 alpha; + small_memcpy(&alpha, src + i, N); + a = F_from_U8(alpha); + } break; + + case Op_load_g8:{ + U8 gray; + small_memcpy(&gray, src + i, N); + r = g = b = F_from_U8(gray); + } break; + + case Op_load_4444:{ + U16 abgr; + small_memcpy(&abgr, src + 2*i, 2*N); + + r = CAST(F, (abgr >> 12) & 0xf) * (1/15.0f); + g = CAST(F, (abgr >> 8) & 0xf) * (1/15.0f); + b = CAST(F, (abgr >> 4) & 0xf) * (1/15.0f); + a = CAST(F, (abgr >> 0) & 0xf) * (1/15.0f); + } break; + case Op_load_565:{ U16 rgb; small_memcpy(&rgb, src + 2*i, 2*N); @@ -879,6 +901,25 @@ static void NS(exec_ops)(const Op* ops, const void** args, // Notice, from here on down the store_ ops all return, ending the loop. + case Op_store_a8: { + U8 alpha = CAST(U8, to_fixed(a * 255)); + small_memcpy(dst + i, &alpha, N); + } return; + + case Op_store_g8: { + // g should be holding luminance (Y) (r,g,b ~~~> X,Y,Z) + U8 gray = CAST(U8, to_fixed(g * 255)); + small_memcpy(dst + i, &gray, N); + } return; + + case Op_store_4444: { + U16 abgr = CAST(U16, to_fixed(r * 15) << 12) + | CAST(U16, to_fixed(g * 15) << 8) + | CAST(U16, to_fixed(b * 15) << 4) + | CAST(U16, to_fixed(a * 15) << 0); + small_memcpy(dst + 2*i, &abgr, 2*N); + } return; + case Op_store_565: { U16 rgb = CAST(U16, to_fixed(r * 31) << 0 ) | CAST(U16, to_fixed(g * 63) << 5 ) |