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-05-02 20:11:46 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-02 20:32:48 +0000
commit908ad22437a5926e7f417dfeb4446722c8dd57dc (patch)
treeb31cf9011c4eb4d07002bd73e6d8421b061d9907 /third_party/skcms
parentbaf9e05233fa2c5694cb62c70be76483dd023a7b (diff)
Roll skia/third_party/skcms baef14c..aee343c (1 commits)
https://skia.googlesource.com/skcms.git/+log/baef14c..aee343c 2018-05-02 brianosman@google.com Remove skcms_EnsureUsableAsDestination* 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: Id25529fc96b68f69dc7baa346d3583710963ddbf Reviewed-on: https://skia-review.googlesource.com/125390 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/skcms.h14
-rw-r--r--third_party/skcms/src/Transform.c64
-rwxr-xr-xthird_party/skcms/version.sha12
3 files changed, 2 insertions, 78 deletions
diff --git a/third_party/skcms/skcms.h b/third_party/skcms/skcms.h
index 36ac4a0fbc..1cfb5b644b 100644
--- a/third_party/skcms/skcms.h
+++ b/third_party/skcms/skcms.h
@@ -209,18 +209,6 @@ SKCMS_API bool skcms_Transform(const void* src,
const skcms_ICCProfile* dstProfile,
size_t npixels);
-// If profile cannot be used as a destination profile in skcms_Transform(),
-// rewrite it with approximations where reasonable or by pulling from fallback
-// (e.g. skcms_sRGB_profile) where not.
-SKCMS_API void skcms_EnsureUsableAsDestination(skcms_ICCProfile* profile,
- const skcms_ICCProfile* fallback);
-
-// If profile cannot be used as a destination profile with a single parametric transfer function,
-// (ie for rasterization), rewrite it with approximations where reasonable or by pulling from
-// fallback (e.g. skcms_sRGB_profile) where not.
-SKCMS_API void skcms_EnsureUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile,
- const skcms_ICCProfile* fallback);
-
// If profile can be used as a destination in skcms_Transform, return true. Otherwise, attempt to
// rewrite it with approximations where reasonable. If successful, return true. If no reasonable
// approximation exists, leave the profile unchanged and return false.
@@ -228,7 +216,7 @@ SKCMS_API bool skcms_MakeUsableAsDestination(skcms_ICCProfile* profile);
// If profile can be used as a destination with a single parametric transfer function (ie for
// rasterization), return true. Otherwise, attempt to rewrite it with approximations where
-// reasonable. If successful, return true. If not reasonable approximation exists, leave the
+// reasonable. If successful, return true. If no reasonable approximation exists, leave the
// profile unchanged and return false.
SKCMS_API bool skcms_MakeUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile);
diff --git a/third_party/skcms/src/Transform.c b/third_party/skcms/src/Transform.c
index ae26e71804..33b8438655 100644
--- a/third_party/skcms/src/Transform.c
+++ b/third_party/skcms/src/Transform.c
@@ -622,39 +622,6 @@ static void assert_usable_as_destination(const skcms_ICCProfile* profile) {
#endif
}
-void skcms_EnsureUsableAsDestination(skcms_ICCProfile* profile, const skcms_ICCProfile* fallback) {
- assert_usable_as_destination(fallback);
-
- skcms_Matrix3x3 fromXYZD50;
- if (!profile->has_toXYZD50 || !skcms_Matrix3x3_invert(&profile->toXYZD50, &fromXYZD50)) {
- profile->toXYZD50 = fallback->toXYZD50;
- }
-
- for (int i = 0; i < 3; i++) {
- skcms_TransferFunction inv;
- if (profile->has_trc && profile->trc[i].table_entries == 0
- && skcms_TransferFunction_invert(&profile->trc[i].parametric, &inv)) {
- continue;
- }
-
- // Note there's a little gap here that we could fill by allowing fitting
- // parametric curves to non-invertible parametric curves.
-
- float max_error;
- 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->has_toXYZD50 = true;
- profile->has_trc = true;
-
- assert_usable_as_destination(profile);
-}
-
static float max_roundtrip_error(const skcms_TransferFunction* inv_tf, const skcms_Curve* curve) {
int N = curve->table_entries ? (int)curve->table_entries : 256;
const float x_scale = 1.0f / (N - 1);
@@ -667,37 +634,6 @@ static float max_roundtrip_error(const skcms_TransferFunction* inv_tf, const skc
return err;
}
-void skcms_EnsureUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile,
- const skcms_ICCProfile* fallback) {
- // Operate on a copy of profile, so we can choose the best TF for the original curves
- skcms_ICCProfile result = *profile;
- skcms_EnsureUsableAsDestination(&result, fallback);
-
- int best_tf = 0;
- float min_max_error = INFINITY_;
- const skcms_ICCProfile* ref = profile->has_trc ? profile : fallback;
- for (int i = 0; i < 3; i++) {
- skcms_TransferFunction inv;
- skcms_TransferFunction_invert(&result.trc[i].parametric, &inv);
-
- float err = 0;
- for (int j = 0; j < 3; ++j) {
- err = fmaxf_(err, max_roundtrip_error(&inv, &ref->trc[j]));
- }
- if (min_max_error > err) {
- min_max_error = err;
- best_tf = i;
- }
- }
-
- for (int i = 0; i < 3; i++) {
- result.trc[i].parametric = result.trc[best_tf].parametric;
- }
-
- *profile = result;
- assert_usable_as_destination(profile);
-}
-
bool skcms_MakeUsableAsDestination(skcms_ICCProfile* profile) {
skcms_Matrix3x3 fromXYZD50;
if (!profile->has_trc || !profile->has_toXYZD50
diff --git a/third_party/skcms/version.sha1 b/third_party/skcms/version.sha1
index d75996c241..e8af40ad8b 100755
--- a/third_party/skcms/version.sha1
+++ b/third_party/skcms/version.sha1
@@ -1 +1 @@
-baef14ce357a67a20251276475241f574cc5e2ee \ No newline at end of file
+aee343ca3bc90ac49f2c410ed3578efad8012710 \ No newline at end of file