aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/skcms
diff options
context:
space:
mode:
authorGravatar skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>2018-04-30 19:44:32 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-30 20:05:34 +0000
commit0ce19fa0b19ddef781d01c03a329a41fdb934a8e (patch)
tree4558ccf8479a87eaa60ada0f34d8bcf3be646564 /third_party/skcms
parent0b34edaa39f51587709d3cd86abd808e24452680 (diff)
Roll skia/third_party/skcms 42c2748..8cf2d2c (1 commits)
https://skia.googlesource.com/skcms.git/+log/42c2748..8cf2d2c 2018-04-30 brianosman@google.com EnsureUsableAsDestination: Don't inherit the polynomial TF from fallback 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. TBR=brianosman@google.com Change-Id: I066d44b73109cabe18936393a3935a1e869107f5 Reviewed-on: https://skia-review.googlesource.com/124683 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/src/Transform.c24
-rwxr-xr-xthird_party/skcms/version.sha12
2 files changed, 14 insertions, 12 deletions
diff --git a/third_party/skcms/src/Transform.c b/third_party/skcms/src/Transform.c
index 818294850e..7aaed63cf6 100644
--- a/third_party/skcms/src/Transform.c
+++ b/third_party/skcms/src/Transform.c
@@ -624,18 +624,16 @@ static void assert_usable_as_destination(const skcms_ICCProfile* profile) {
void skcms_EnsureUsableAsDestination(skcms_ICCProfile* profile, const skcms_ICCProfile* fallback) {
assert_usable_as_destination(fallback);
- skcms_ICCProfile ok = *fallback;
skcms_Matrix3x3 fromXYZD50;
- if (profile->has_toXYZD50 && skcms_Matrix3x3_invert(&profile->toXYZD50, &fromXYZD50)) {
- ok.toXYZD50 = profile->toXYZD50;
+ if (!profile->has_toXYZD50 || !skcms_Matrix3x3_invert(&profile->toXYZD50, &fromXYZD50)) {
+ profile->toXYZD50 = fallback->toXYZD50;
}
- for (int i = 0; profile->has_trc && i < 3; i++) {
+ for (int i = 0; i < 3; i++) {
skcms_TransferFunction inv;
- if (profile->trc[i].table_entries == 0
+ if (profile->has_trc && profile->trc[i].table_entries == 0
&& skcms_TransferFunction_invert(&profile->trc[i].parametric, &inv)) {
- ok.trc[i] = profile->trc[i];
continue;
}
@@ -643,13 +641,17 @@ void skcms_EnsureUsableAsDestination(skcms_ICCProfile* profile, const skcms_ICCP
// parametric curves to non-invertible parametric curves.
float max_error;
- if (skcms_ApproximateCurve(&profile->trc[i], &ok.trc[i].parametric, &max_error)) {
- // Parametric curves from skcms_ApproximateCurve() are guaranteed to be invertible.
- ok.trc[i].table_entries = 0;
- }
+ skcms_TransferFunction tf = fallback->trc[i].parametric;
+ // Parametric curves from skcms_ApproximateCurve() are guaranteed to be invertible.
+ // If approximation fails, tf will still hold fallback's parametric TRC curve.
+ (void)skcms_ApproximateCurve(&profile->trc[i], &tf, &max_error);
+ profile->trc[i].table_entries = 0;
+ profile->trc[i].parametric = tf;
}
- *profile = ok;
+ profile->has_toXYZD50 = true;
+ profile->has_trc = true;
+
assert_usable_as_destination(profile);
}
diff --git a/third_party/skcms/version.sha1 b/third_party/skcms/version.sha1
index db34bce1c4..d6f962d29e 100755
--- a/third_party/skcms/version.sha1
+++ b/third_party/skcms/version.sha1
@@ -1 +1 @@
-42c27486c1ffb16339be984eb6dde03e714a2c65 \ No newline at end of file
+8cf2d2cdaaaf5d4365c67d9d17ea079bb749b29c \ No newline at end of file