summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-10-27 08:48:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-27 10:58:04 +0200
commit551e5943d4bec10c31077f38ccf5d8149c05265c (patch)
treeb987153b2cb1b09f2d33cd774bd7ffd6878354d3 /include/tools
parentab83d7d57d0fae106037b12651adb397b48354e4 (diff)
tdf#123419 optimise ImplMakeFraction
which is very hot here. Push it down into Fraction, where we can skip the construction of boost::rational intermediate values Change-Id: I7e5f18456a252a159d3a50e9297168e5ba9e1588 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141894 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/fract.hxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/tools/fract.hxx b/include/tools/fract.hxx
index c844f8eed619..e1305ca8a8fd 100644
--- a/include/tools/fract.hxx
+++ b/include/tools/fract.hxx
@@ -72,6 +72,9 @@ public:
void ReduceInaccurate( unsigned nSignificantBits );
+ /// Multiply the two fractions represented here and reduce inaccuracy to 32-bits, used by vcl
+ static Fraction MakeFraction(tools::Long nN1, tools::Long nN2, tools::Long nD1, tools::Long nD2);
+
// Compute value usable as hash.
size_t GetHashValue() const;