diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-11-19 10:41:18 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-11-19 12:12:31 +0100 |
commit | 6ec95f00083df7e48c5e95879a778e4d0d3c62d5 (patch) | |
tree | eb83b39fd823259ca33721876a60826c3bfb7e4f /include/vcl/outdev.hxx | |
parent | 26a0e88bcd3b443ca4b827d91b85f67e490ade1c (diff) |
Drop threshold for BigInt arithmetics from ImplLogicToPixel/ImplPixelToLogic
Initially (since commit 8ab086b6cc054501bfbf7ef6fa509c393691e860) the code
in vcl/source/outdev/map.cxx used BigInt arithmetics for overflowing cases.
Then in commit 99a299383f2f16e5e8eefbb28e88a6a8f90ab95b, the code started
to use sal_Int64, and ignored the threshold. Immideately in next day's
commit 7bbb9d113a732851831dfadf8dee6b980dc0ab3b, the fallback to BigInt
was restored - "when 64bit arithmetic does not suffice for mapping".
Commit d563ac66ae12353c2c25d154fc9f493df67b3b8b made two modes - one using
sal_Int64, and one using BigInt - separate (dependent on USE_64BIT_INTS),
and introduced shortcut depending on threshold also into USE_64BIT_INTS
code, dependent on SAL_TYPES_SIZEOFLONG ("#i55136# prefer native int math
over int64").
BigInt code was dropped in commit b5100f8a1c76a921406ed3d3a54ba2479b011977.
So now, after the functions take tools::Long, and it is 64-bit on _WIN64,
it's incorrect to depend on SAL_TYPES_SIZEOFLONG for the shortcut. And
making it dependent on sizeof(tools::Long) seems unnecessary, because now
it's only active to 32-bit platforms with decreasing relevance, and the
profit there is unclear, having to calculate threshold for each operation
on all platforms.
So this drops the threshold unconditionally, unifying the code on all
platforms. If BigInt mode would be necessary, this should be reintroduced
on all platforms, but for now we rely on 64-bit arithmetics, as we did
before this patch.
And while at it, replaced outdated uses of LONG_MAX/LONG_MIN with correct
numeric limits for tools::Long, to avoid more BigInt operations.
Change-Id: I8d6039c851d76712b391e754d3f78a97a8463f05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106121
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/vcl/outdev.hxx')
-rw-r--r-- | include/vcl/outdev.hxx | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index ea8292909a39..1b29dddf532b 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -353,7 +353,6 @@ private: DrawModeFlags mnDrawMode; ComplexTextLayoutFlags mnTextLayoutMode; ImplMapRes maMapRes; - ImplThresholdRes maThresRes; const OutDevType meOutDevType; OutDevViewType meOutDevViewType; vcl::Region maRegion; // contains the clip region, see SetClipRegion(...) |