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 /include/vcl | |
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 'include/vcl')
-rw-r--r-- | include/vcl/checksum.hxx | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx index 351820e1aefe..ea2c9adb2e51 100644 --- a/include/vcl/checksum.hxx +++ b/include/vcl/checksum.hxx @@ -16,18 +16,15 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - - -#ifndef INCLUDED_VCL_INC_CHECKSUM_HXX -#define INCLUDED_VCL_INC_CHECKSUM_HXX +#pragma once #include <sal/config.h> #include <sal/types.h> #include <vcl/dllapi.h> -#define BITMAP_CHECKSUM_SIZE 8 +#define BITMAP_CHECKSUM_SIZE 4 -typedef sal_uInt64 BitmapChecksum; +typedef sal_uInt32 BitmapChecksum; typedef sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE]; template< sal_uInt8 N = 0 > @@ -43,39 +40,4 @@ inline void BCToBCOA< BITMAP_CHECKSUM_SIZE >( BitmapChecksum, BitmapChecksumOcte return; } -extern "C" { - -/*======================================================================== - * - * vcl_crc64 interface. - * - *======================================================================*/ -/** Evaluate CRC64 over given data. - - This function evaluates the CRC polynomial 0xEDB88320. - - @param Crc [in] CRC64 over previous data or zero. - @param Data [in] data buffer. - @param DatLen [in] data buffer length. - @return new CRC64 value. - */ -VCL_DLLPUBLIC sal_uInt64 vcl_crc64 ( - sal_uInt64 Crc, - const void *Data, sal_uInt32 DatLen -) SAL_THROW_EXTERN_C(); - -} - -inline BitmapChecksum vcl_get_checksum ( - BitmapChecksum Checksum, - const void *Data, - sal_uInt32 DatLen -) -{ - return static_cast<BitmapChecksum>(vcl_crc64( Checksum, Data, DatLen )); -} - - -#endif // INCLUDED_VCL_INC_CHECKSUM_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |