Roll skia/third_party/skcms ca80251f9aca..cd2260c9f528 (1 commits)
https://skia.googlesource.com/skcms.git/+log/ca80251f9aca..cd2260c9f528 2019-01-14 mtklein@google.com clean up SKCMS_LEGACY_TF_INVERT The AutoRoll server is located here: https://autoroll.skia.org/r/skcms-skia-autoroll 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=luci.chromium.try:linux-blink-rel TBR=halcanary@google.com Change-Id: I3c5d242258fdd59b63703e467ec69168f03b0077 Reviewed-on: https://skia-review.googlesource.com/c/183785 Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com> Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
This commit is contained in:
parent
3f4cd774e6
commit
f2a4cc1a7b
10
third_party/skcms/skcms.cc
vendored
10
third_party/skcms/skcms.cc
vendored
@ -1105,11 +1105,7 @@ const skcms_TransferFunction* skcms_sRGB_TransferFunction() {
|
||||
|
||||
const skcms_TransferFunction* skcms_sRGB_Inverse_TransferFunction() {
|
||||
static const skcms_TransferFunction sRGB_inv =
|
||||
#ifndef SKCMS_LEGACY_TF_INVERT
|
||||
{0.416666657f, 1.137283325f, -0.0f, 12.920000076f, 0.003130805f, -0.054969788f, -0.0f};
|
||||
#else
|
||||
{ (float)(1/2.4), 1.137119f, 0, 12.92f, 0.0031308f, -0.055f, 0 };
|
||||
#endif
|
||||
return &sRGB_inv;
|
||||
}
|
||||
|
||||
@ -1453,24 +1449,18 @@ bool skcms_TransferFunction_invert(const skcms_TransferFunction* src, skcms_Tran
|
||||
// (1/a)( y - e)^1/g - b/a = x
|
||||
// (ky - ke)^1/g - b/a = x
|
||||
|
||||
#ifndef SKCMS_LEGACY_TF_INVERT
|
||||
float k = powf_(src->a, -src->g); // (1/a)^g == a^-g
|
||||
#else
|
||||
float k = powf_(1.0f / src->a, src->g);
|
||||
#endif
|
||||
inv.g = 1.0f / src->g;
|
||||
inv.a = k;
|
||||
inv.b = -k * src->e;
|
||||
inv.e = -src->b / src->a;
|
||||
|
||||
#ifndef SKCMS_LEGACY_TF_INVERT
|
||||
// Now in principle we're done.
|
||||
// But to preserve the valuable invariant inv(src(1.0f)) == 1.0f,
|
||||
// we'll tweak e. These two values should be close to each other,
|
||||
// just down to numerical precision issues, especially from powf_.
|
||||
float s = powf_(src->a + src->b, src->g) + src->e;
|
||||
inv.e = 1.0f - powf_(inv.a * s + inv.b, inv.g);
|
||||
#endif
|
||||
|
||||
*dst = inv;
|
||||
return tf_is_valid(dst);
|
||||
|
2
third_party/skcms/version.sha1
vendored
2
third_party/skcms/version.sha1
vendored
@ -1 +1 @@
|
||||
ca80251f9aca2a4cb2cf98cca200025040f4c9bc
|
||||
cd2260c9f5289b05d6b23797a291e54508026823
|
Loading…
Reference in New Issue
Block a user