aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Eric Karl <ericrk@chromium.org>2017-12-16 00:40:08 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-16 00:40:13 +0000
commitdd821bc56488d4ec2a9f797f271b0b669800f2e1 (patch)
treed30ab463e674c279770b919f34c18d0c0b7d81ce /include
parentaae533e418f37d788cdb1a1177e882d0f8868b62 (diff)
Revert "Increase accuracy of float -> fixed in ICC code"
This reverts commit ef8dda227b55445de090cfc5c59fb633f8a1763d. Reason for revert: This is breaking WebKit layout tests on linux and blocking the autoroller. Probably just needs a rebase. See: https://storage.googleapis.com/chromium-layout-test-archives/linux_trusty_blink_rel/20229/layout-test-results/results.html Original change's description: > Increase accuracy of float -> fixed in ICC code > > Add a comment to SkFixed explaining the accuracy issues of the macros. > > Bug: skia: > Change-Id: Ibfecb16821fefe87822cc3acd1cf8498df10a492 > Reviewed-on: https://skia-review.googlesource.com/85742 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=mtklein@chromium.org,brianosman@google.com,reed@google.com Change-Id: I354327767bd59a6104b1431b053721c3102719be No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/86281 Reviewed-by: Eric Karl <ericrk@chromium.org> Commit-Queue: Eric Karl <ericrk@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/private/SkFixed.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/include/private/SkFixed.h b/include/private/SkFixed.h
index 05e1de49c9..adb0343bc7 100644
--- a/include/private/SkFixed.h
+++ b/include/private/SkFixed.h
@@ -30,11 +30,6 @@ typedef int32_t SkFixed;
#define SK_FixedTanPIOver8 (0x6A0A)
#define SK_FixedRoot2Over2 (0xB505)
-// NOTE: SkFixedToFloat is exact. SkFloatToFixed seems to lack a rounding step. For all fixed-point
-// values, this version is as accurate as possible for (fixed -> float -> fixed). Rounding reduces
-// accuracy if the intermediate floats are in the range that only holds integers (adding 0.5f to an
-// odd integer then snaps to nearest even). Using double for the rounding math gives maximum
-// accuracy for (float -> fixed -> float), but that's usually overkill.
#define SkFixedToFloat(x) ((x) * 1.52587890625e-5f)
#define SkFloatToFixed(x) sk_float_saturate2int((x) * SK_Fixed1)