diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-10-27 11:18:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-10-27 22:03:24 +0200 |
commit | 1d86a0b632813efb2259b795b272f8aa40a7c768 (patch) | |
tree | b9c330e4de7e3840a2754a473f606e29dfdc99fb /vcl/source/animate/Animation.cxx | |
parent | 9b5a00d2281bebaac5fccfde17de6ca5134fc229 (diff) |
tdf#152571 speedup slow draw file save
with lots of images, we seem to spend lots of time calculating
CRC. Replace the vcl checksum/CRC with rtl_crc32 in sal/, which
forwards to the zlib implementation, which has all kinds of
nice SIMD code for performance.
Change-Id: I295e2ee91b3450fa558b06e67aac0fbb20b85f52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158529
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/animate/Animation.cxx')
-rw-r--r-- | vcl/source/animate/Animation.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx index 9f890c6568d3..5f2b8ce153ee 100644 --- a/vcl/source/animate/Animation.cxx +++ b/vcl/source/animate/Animation.cxx @@ -20,6 +20,7 @@ #include <algorithm> #include <sal/config.h> +#include <rtl/crc.h> #include <tools/stream.hxx> #include <tools/GenericTypeSerializer.hxx> #include <sal/log.hxx> @@ -144,18 +145,18 @@ BitmapChecksum Animation::GetChecksum() const BitmapChecksum nCrc = GetBitmapEx().GetChecksum(); UInt32ToSVBT32(maFrames.size(), aBT32); - nCrc = vcl_get_checksum(nCrc, aBT32, 4); + nCrc = rtl_crc32(nCrc, aBT32, 4); Int32ToSVBT32(maGlobalSize.Width(), aBT32); - nCrc = vcl_get_checksum(nCrc, aBT32, 4); + nCrc = rtl_crc32(nCrc, aBT32, 4); Int32ToSVBT32(maGlobalSize.Height(), aBT32); - nCrc = vcl_get_checksum(nCrc, aBT32, 4); + nCrc = rtl_crc32(nCrc, aBT32, 4); for (auto const& i : maFrames) { BCToBCOA(i->GetChecksum(), aBCOA); - nCrc = vcl_get_checksum(nCrc, aBCOA, BITMAP_CHECKSUM_SIZE); + nCrc = rtl_crc32(nCrc, aBCOA, BITMAP_CHECKSUM_SIZE); } return nCrc; |