aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/skcms/src/Transform_inl.h
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-15 15:06:08 +0000
committerGravatar Mike Klein <mtklein@chromium.org>2018-05-15 15:38:17 +0000
commit12a9c455034256c68e50e1bbac81b49648d14ecb (patch)
tree19d6f2cefb84ff988823beda8050e0cf55a52410 /third_party/skcms/src/Transform_inl.h
parentf169e1f81fb2d81b7a0cc775ce6a7e1d7dfb62c2 (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/src/Transform_inl.h')
-rw-r--r--third_party/skcms/src/Transform_inl.h12
1 files changed, 7 insertions, 5 deletions
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_)