diff options
author | skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com> | 2018-05-15 15:06:08 +0000 |
---|---|---|
committer | Mike Klein <mtklein@chromium.org> | 2018-05-15 15:38:17 +0000 |
commit | 12a9c455034256c68e50e1bbac81b49648d14ecb (patch) | |
tree | 19d6f2cefb84ff988823beda8050e0cf55a52410 /third_party/skcms | |
parent | f169e1f81fb2d81b7a0cc775ce6a7e1d7dfb62c2 (diff) |
Roll skia/third_party/skcms 28e8b32..14c31bf (6 commits)
https://skia.googlesource.com/skcms.git/+log/28e8b32..14c31bf
2018-05-15 mtklein@chromium.org temporarily turn on SKCMS_LEGACY_POWF for GN builds
2018-05-15 mtklein@chromium.org spin sources list out of BUILD.gn
2018-05-14 mtklein@chromium.org Reland "remove loop in powf"
2018-05-14 mtklein@chromium.org Revert "remove loop in powf"
2018-05-14 brianosman@google.com Adjust fuzzers to test against parametric approximated tables
2018-05-14 mtklein@chromium.org remove loop in powf
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=herb@google.com
Change-Id: I0ff3903370a7c07ce7e194ab44c35ff546b7f973
Reviewed-on: https://skia-review.googlesource.com/128284
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')
-rw-r--r-- | third_party/skcms/BUILD.gn | 22 | ||||
-rw-r--r-- | third_party/skcms/skcms.gni | 22 | ||||
-rw-r--r-- | third_party/skcms/src/ICCProfile.c | 6 | ||||
-rw-r--r-- | third_party/skcms/src/PortableMath.c | 11 | ||||
-rw-r--r-- | third_party/skcms/src/Transform_inl.h | 12 | ||||
-rwxr-xr-x | third_party/skcms/version.sha1 | 2 |
6 files changed, 44 insertions, 31 deletions
diff --git a/third_party/skcms/BUILD.gn b/third_party/skcms/BUILD.gn index 44439c41e6..d4e5220e2f 100644 --- a/third_party/skcms/BUILD.gn +++ b/third_party/skcms/BUILD.gn @@ -3,6 +3,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("skcms.gni") + config("skcms_public") { include_dirs = [ "." ] } @@ -18,25 +20,9 @@ source_set("skcms") { ] } - defines = [] + defines = [ "SKCMS_LEGACY_POWF" ] public = [ "skcms.h", ] - sources = [ - "src/GaussNewton.c", - "src/GaussNewton.h", - "src/ICCProfile.c", - "src/LinearAlgebra.c", - "src/LinearAlgebra.h", - "src/Macros.h", - "src/PolyTF.c", - "src/PortableMath.c", - "src/PortableMath.h", - "src/RandomBytes.h", - "src/TransferFunction.c", - "src/TransferFunction.h", - "src/Transform.c", - "src/Transform.h", - "src/Transform_inl.h", - ] + sources = skcms_sources } diff --git a/third_party/skcms/skcms.gni b/third_party/skcms/skcms.gni new file mode 100644 index 0000000000..db3bc9e0d2 --- /dev/null +++ b/third_party/skcms/skcms.gni @@ -0,0 +1,22 @@ +# Copyright 2018 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +skcms_sources = [ + "src/GaussNewton.c", + "src/GaussNewton.h", + "src/ICCProfile.c", + "src/LinearAlgebra.c", + "src/LinearAlgebra.h", + "src/Macros.h", + "src/PolyTF.c", + "src/PortableMath.c", + "src/PortableMath.h", + "src/RandomBytes.h", + "src/TransferFunction.c", + "src/TransferFunction.h", + "src/Transform.c", + "src/Transform.h", + "src/Transform_inl.h", +] diff --git a/third_party/skcms/src/ICCProfile.c b/third_party/skcms/src/ICCProfile.c index 6b8c25df06..b3f34d10ce 100644 --- a/third_party/skcms/src/ICCProfile.c +++ b/third_party/skcms/src/ICCProfile.c @@ -834,9 +834,9 @@ const skcms_ICCProfile* skcms_sRGB_profile() { .has_poly_tf = { true, true, true }, .poly_tf = { - {0.293833881617f, 0.704207003117f, (float)(1/12.92), 0.04045f}, - {0.293833881617f, 0.704207003117f, (float)(1/12.92), 0.04045f}, - {0.293833881617f, 0.704207003117f, (float)(1/12.92), 0.04045f}, + {0.294143557548523f, 0.703896820545197f, (float)(1/12.92), 0.04045f}, + {0.294143557548523f, 0.703896820545197f, (float)(1/12.92), 0.04045f}, + {0.294143557548523f, 0.703896820545197f, (float)(1/12.92), 0.04045f}, }, }; return &sRGB_profile; diff --git a/third_party/skcms/src/PortableMath.c b/third_party/skcms/src/PortableMath.c index d63d6abb0c..a2e62a53a8 100644 --- a/third_party/skcms/src/PortableMath.c +++ b/third_party/skcms/src/PortableMath.c @@ -50,13 +50,16 @@ float exp2f_(float x) { } float powf_(float x, float y) { - // Handling all the integral powers first increases our precision a little. If y is very large, - // this loop may never terminate, but for any reasonably large y, the approximation is fine. +#if defined(SKCMS_LEGACY_POWF) float r = 1.0f; while (y >= 1.0f && y < 32) { r *= x; y -= 1.0f; } - - return (x == 0) || (x == 1) ? x : r * exp2f_(log2f_(x) * y); + return (x == 0) || (x == 1) ? x + : r * exp2f_(log2f_(x) * y); +#else + return (x == 0) || (x == 1) ? x + : exp2f_(log2f_(x) * y); +#endif } diff --git a/third_party/skcms/src/Transform_inl.h b/third_party/skcms/src/Transform_inl.h index debdf68a88..15f19a0638 100644 --- a/third_party/skcms/src/Transform_inl.h +++ b/third_party/skcms/src/Transform_inl.h @@ -221,16 +221,18 @@ SI ATTR F NS(approx_exp2_)(F x) { #define approx_exp2 NS(approx_exp2_) SI ATTR F NS(approx_pow_)(F x, float y) { - // Handling all the integral powers first increases our precision a little. +#if defined(SKCMS_LEGACY_POWF) F r = F1; while (y >= 1.0f) { r *= x; y -= 1.0f; } - - // TODO: The rest of this could perhaps be specialized further knowing 0 <= y < 1. - assert (0 <= y && y < 1); - return (F)if_then_else((x == F0) | (x == F1), x, r * approx_exp2(approx_log2(x) * y)); + return (F)if_then_else((x == F0) | (x == F1), x + , r * approx_exp2(approx_log2(x) * y)); +#else + return (F)if_then_else((x == F0) | (x == F1), x + , approx_exp2(approx_log2(x) * y)); +#endif } #define approx_pow NS(approx_pow_) diff --git a/third_party/skcms/version.sha1 b/third_party/skcms/version.sha1 index 720d2402e3..7aead83515 100755 --- a/third_party/skcms/version.sha1 +++ b/third_party/skcms/version.sha1 @@ -1 +1 @@ -28e8b3248d725ed1a7e71d0c9d3dffb3cee2c561
\ No newline at end of file +14c31bf04af5c4a2b5ae9e1d1944f2173fb4570e
\ No newline at end of file |