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-03 20:00:46 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-03 20:50:42 +0000 |
commit | d5e7b0b46e028abc4425f5c3bb085d6cbf110897 (patch) | |
tree | 97eb4b0c948dfc4c11ec9937a86ee33922e920c2 /third_party | |
parent | ba2c826038a77046b99b9d2583e2eae70087ceed (diff) |
Roll skia/third_party/skcms aee343c..cc1799c (1 commits)
https://skia.googlesource.com/skcms.git/+log/aee343c..cc1799c
2018-05-03 brianosman@google.com Enforce constraints at the start of nonlinear fitting
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=brianosman@google.com
Change-Id: Ic85d08764124fd57fc44950001d2f67348984fa2
Reviewed-on: https://skia-review.googlesource.com/125779
Reviewed-by: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/skcms/src/TransferFunction.c | 23 | ||||
-rwxr-xr-x | third_party/skcms/version.sha1 | 2 |
2 files changed, 16 insertions, 9 deletions
diff --git a/third_party/skcms/src/TransferFunction.c b/third_party/skcms/src/TransferFunction.c index df728e1c7f..c1fce37b0b 100644 --- a/third_party/skcms/src/TransferFunction.c +++ b/third_party/skcms/src/TransferFunction.c @@ -238,6 +238,14 @@ static bool fit_nonlinear(const skcms_Curve* curve, int start, int N, skcms_Tran for (int j = 0; j < 3/*TODO: tune*/; j++) { // These extra constraints a >= 0 and ad+b >= 0 are not modeled in the optimization. + // We don't really know how to fix up a if it goes negative. + if (P[1] < 0) { + return false; + } + // If ad+b goes negative, we feel just barely not uneasy enough to tweak b so ad+b is zero. + if (P[1] * tf->d + P[2] < 0) { + P[2] = -P[1] * tf->d; + } assert (P[1] >= 0 && P[1] * tf->d + P[2] >= 0); @@ -247,15 +255,14 @@ static bool fit_nonlinear(const skcms_Curve* curve, int start, int N, skcms_Tran start*x_scale, 1, N-start)) { return false; } + } - // We don't really know how to fix up a if it goes negative. - if (P[1] < 0) { - return false; - } - // If ad+b goes negative, we feel just barely not uneasy enough to tweak b so ad+b is zero. - if (P[1] * tf->d + P[2] < 0) { - P[2] = -P[1] * tf->d; - } + // We need to apply our fixups one last time + if (P[1] < 0) { + return false; + } + if (P[1] * tf->d + P[2] < 0) { + P[2] = -P[1] * tf->d; } tf->g = P[0]; diff --git a/third_party/skcms/version.sha1 b/third_party/skcms/version.sha1 index e8af40ad8b..9cabfc9743 100755 --- a/third_party/skcms/version.sha1 +++ b/third_party/skcms/version.sha1 @@ -1 +1 @@ -aee343ca3bc90ac49f2c410ed3578efad8012710
\ No newline at end of file +cc1799c6b4fce905ad3810924d1a1a73b10ec230
\ No newline at end of file |