[Libreoffice-commits] core.git: 19 commits - filter/source include/vcl svtools/source sw/qa vcl/inc vcl/Library_vcl.mk vcl/opengl vcl/Package_opengl.mk vcl/qa vcl/source vcl/unx
Marco Cecchetti
marco.cecchetti at collabora.com
Tue Sep 1 08:21:54 PDT 2015
filter/source/flash/swfexporter.cxx | 14 +-
filter/source/flash/swfexporter.hxx | 7 -
filter/source/flash/swfwriter.hxx | 3
filter/source/flash/swfwriter1.cxx | 2
filter/source/svg/svgexport.cxx | 10 -
filter/source/svg/svgwriter.cxx | 8 -
filter/source/svg/svgwriter.hxx | 2
include/vcl/alpha.hxx | 2
include/vcl/animate.hxx | 4
include/vcl/bitmap.hxx | 3
include/vcl/bitmapex.hxx | 2
include/vcl/checksum.hxx | 92 +++++++++++++
include/vcl/gdimtf.hxx | 2
include/vcl/graph.hxx | 4
svtools/source/graphic/grfcache.cxx | 8 -
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 2
vcl/Library_vcl.mk | 1
vcl/Package_opengl.mk | 1
vcl/inc/impbmp.hxx | 7 -
vcl/inc/impgraph.hxx | 2
vcl/inc/opengl/program.hxx | 2
vcl/inc/opengl/salbmp.hxx | 3
vcl/inc/salbmp.hxx | 50 +++++++
vcl/opengl/areaHashCRC64TFragmentShader.glsl | 87 +++++++++++++
vcl/opengl/program.cxx | 2
vcl/opengl/salbmp.cxx | 101 +++++++++++++++
vcl/qa/cppunit/BitmapTest.cxx | 57 ++++++++
vcl/source/bitmap/checksum.cxx | 154 +++++++++++++++++++++++
vcl/source/gdi/animate.cxx | 35 ++---
vcl/source/gdi/bitmap.cxx | 54 --------
vcl/source/gdi/bitmapex.cxx | 13 +
vcl/source/gdi/gdimtf.cxx | 179 +++++++++++++--------------
vcl/source/gdi/graph.cxx | 2
vcl/source/gdi/impbmp.cxx | 26 +++
vcl/source/gdi/impgraph.cxx | 4
vcl/source/gdi/pdfwriter_impl.cxx | 2
vcl/source/gdi/pdfwriter_impl.hxx | 4
vcl/unx/gtk/app/gtkinst.cxx | 2
38 files changed, 737 insertions(+), 216 deletions(-)
New commits:
commit 7a12d4d7fde8e80774c968956f2e5ec5d30e545e
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Tue Sep 1 14:12:32 2015 +0200
Removed the crc table from the check-sum header
Now can be accessed through the vcl_get_crc64_table() function
Change-Id: Ife85dde373a48652a0d67460184c1f325eb91702
diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 8b14954..7e1076f 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -30,101 +30,6 @@
#include <boost/preprocessor/arithmetic/mul.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-
-/*========================================================================
- *
- * vcl_crc64Table (CRC polynomial 0x95AC9329AC4BC9B5ULL).
- *
- *======================================================================*/
-static const sal_uInt64 vcl_crc64Table[256] = {
- 0x0000000000000000ULL, 0x7ad870c830358979ULL, 0xf5b0e190606b12f2ULL,
- 0x8f689158505e9b8bULL, 0xc038e5739841b68fULL, 0xbae095bba8743ff6ULL,
- 0x358804e3f82aa47dULL, 0x4f50742bc81f2d04ULL, 0xab28ecb46814fe75ULL,
- 0xd1f09c7c5821770cULL, 0x5e980d24087fec87ULL, 0x24407dec384a65feULL,
- 0x6b1009c7f05548faULL, 0x11c8790fc060c183ULL, 0x9ea0e857903e5a08ULL,
- 0xe478989fa00bd371ULL, 0x7d08ff3b88be6f81ULL, 0x07d08ff3b88be6f8ULL,
- 0x88b81eabe8d57d73ULL, 0xf2606e63d8e0f40aULL, 0xbd301a4810ffd90eULL,
- 0xc7e86a8020ca5077ULL, 0x4880fbd87094cbfcULL, 0x32588b1040a14285ULL,
- 0xd620138fe0aa91f4ULL, 0xacf86347d09f188dULL, 0x2390f21f80c18306ULL,
- 0x594882d7b0f40a7fULL, 0x1618f6fc78eb277bULL, 0x6cc0863448deae02ULL,
- 0xe3a8176c18803589ULL, 0x997067a428b5bcf0ULL, 0xfa11fe77117cdf02ULL,
- 0x80c98ebf2149567bULL, 0x0fa11fe77117cdf0ULL, 0x75796f2f41224489ULL,
- 0x3a291b04893d698dULL, 0x40f16bccb908e0f4ULL, 0xcf99fa94e9567b7fULL,
- 0xb5418a5cd963f206ULL, 0x513912c379682177ULL, 0x2be1620b495da80eULL,
- 0xa489f35319033385ULL, 0xde51839b2936bafcULL, 0x9101f7b0e12997f8ULL,
- 0xebd98778d11c1e81ULL, 0x64b116208142850aULL, 0x1e6966e8b1770c73ULL,
- 0x8719014c99c2b083ULL, 0xfdc17184a9f739faULL, 0x72a9e0dcf9a9a271ULL,
- 0x08719014c99c2b08ULL, 0x4721e43f0183060cULL, 0x3df994f731b68f75ULL,
- 0xb29105af61e814feULL, 0xc849756751dd9d87ULL, 0x2c31edf8f1d64ef6ULL,
- 0x56e99d30c1e3c78fULL, 0xd9810c6891bd5c04ULL, 0xa3597ca0a188d57dULL,
- 0xec09088b6997f879ULL, 0x96d1784359a27100ULL, 0x19b9e91b09fcea8bULL,
- 0x636199d339c963f2ULL, 0xdf7adabd7a6e2d6fULL, 0xa5a2aa754a5ba416ULL,
- 0x2aca3b2d1a053f9dULL, 0x50124be52a30b6e4ULL, 0x1f423fcee22f9be0ULL,
- 0x659a4f06d21a1299ULL, 0xeaf2de5e82448912ULL, 0x902aae96b271006bULL,
- 0x74523609127ad31aULL, 0x0e8a46c1224f5a63ULL, 0x81e2d7997211c1e8ULL,
- 0xfb3aa75142244891ULL, 0xb46ad37a8a3b6595ULL, 0xceb2a3b2ba0eececULL,
- 0x41da32eaea507767ULL, 0x3b024222da65fe1eULL, 0xa2722586f2d042eeULL,
- 0xd8aa554ec2e5cb97ULL, 0x57c2c41692bb501cULL, 0x2d1ab4dea28ed965ULL,
- 0x624ac0f56a91f461ULL, 0x1892b03d5aa47d18ULL, 0x97fa21650afae693ULL,
- 0xed2251ad3acf6feaULL, 0x095ac9329ac4bc9bULL, 0x7382b9faaaf135e2ULL,
- 0xfcea28a2faafae69ULL, 0x8632586aca9a2710ULL, 0xc9622c4102850a14ULL,
- 0xb3ba5c8932b0836dULL, 0x3cd2cdd162ee18e6ULL, 0x460abd1952db919fULL,
- 0x256b24ca6b12f26dULL, 0x5fb354025b277b14ULL, 0xd0dbc55a0b79e09fULL,
- 0xaa03b5923b4c69e6ULL, 0xe553c1b9f35344e2ULL, 0x9f8bb171c366cd9bULL,
- 0x10e3202993385610ULL, 0x6a3b50e1a30ddf69ULL, 0x8e43c87e03060c18ULL,
- 0xf49bb8b633338561ULL, 0x7bf329ee636d1eeaULL, 0x012b592653589793ULL,
- 0x4e7b2d0d9b47ba97ULL, 0x34a35dc5ab7233eeULL, 0xbbcbcc9dfb2ca865ULL,
- 0xc113bc55cb19211cULL, 0x5863dbf1e3ac9decULL, 0x22bbab39d3991495ULL,
- 0xadd33a6183c78f1eULL, 0xd70b4aa9b3f20667ULL, 0x985b3e827bed2b63ULL,
- 0xe2834e4a4bd8a21aULL, 0x6debdf121b863991ULL, 0x1733afda2bb3b0e8ULL,
- 0xf34b37458bb86399ULL, 0x8993478dbb8deae0ULL, 0x06fbd6d5ebd3716bULL,
- 0x7c23a61ddbe6f812ULL, 0x3373d23613f9d516ULL, 0x49aba2fe23cc5c6fULL,
- 0xc6c333a67392c7e4ULL, 0xbc1b436e43a74e9dULL, 0x95ac9329ac4bc9b5ULL,
- 0xef74e3e19c7e40ccULL, 0x601c72b9cc20db47ULL, 0x1ac40271fc15523eULL,
- 0x5594765a340a7f3aULL, 0x2f4c0692043ff643ULL, 0xa02497ca54616dc8ULL,
- 0xdafce7026454e4b1ULL, 0x3e847f9dc45f37c0ULL, 0x445c0f55f46abeb9ULL,
- 0xcb349e0da4342532ULL, 0xb1eceec59401ac4bULL, 0xfebc9aee5c1e814fULL,
- 0x8464ea266c2b0836ULL, 0x0b0c7b7e3c7593bdULL, 0x71d40bb60c401ac4ULL,
- 0xe8a46c1224f5a634ULL, 0x927c1cda14c02f4dULL, 0x1d148d82449eb4c6ULL,
- 0x67ccfd4a74ab3dbfULL, 0x289c8961bcb410bbULL, 0x5244f9a98c8199c2ULL,
- 0xdd2c68f1dcdf0249ULL, 0xa7f41839ecea8b30ULL, 0x438c80a64ce15841ULL,
- 0x3954f06e7cd4d138ULL, 0xb63c61362c8a4ab3ULL, 0xcce411fe1cbfc3caULL,
- 0x83b465d5d4a0eeceULL, 0xf96c151de49567b7ULL, 0x76048445b4cbfc3cULL,
- 0x0cdcf48d84fe7545ULL, 0x6fbd6d5ebd3716b7ULL, 0x15651d968d029fceULL,
- 0x9a0d8ccedd5c0445ULL, 0xe0d5fc06ed698d3cULL, 0xaf85882d2576a038ULL,
- 0xd55df8e515432941ULL, 0x5a3569bd451db2caULL, 0x20ed197575283bb3ULL,
- 0xc49581ead523e8c2ULL, 0xbe4df122e51661bbULL, 0x3125607ab548fa30ULL,
- 0x4bfd10b2857d7349ULL, 0x04ad64994d625e4dULL, 0x7e7514517d57d734ULL,
- 0xf11d85092d094cbfULL, 0x8bc5f5c11d3cc5c6ULL, 0x12b5926535897936ULL,
- 0x686de2ad05bcf04fULL, 0xe70573f555e26bc4ULL, 0x9ddd033d65d7e2bdULL,
- 0xd28d7716adc8cfb9ULL, 0xa85507de9dfd46c0ULL, 0x273d9686cda3dd4bULL,
- 0x5de5e64efd965432ULL, 0xb99d7ed15d9d8743ULL, 0xc3450e196da80e3aULL,
- 0x4c2d9f413df695b1ULL, 0x36f5ef890dc31cc8ULL, 0x79a59ba2c5dc31ccULL,
- 0x037deb6af5e9b8b5ULL, 0x8c157a32a5b7233eULL, 0xf6cd0afa9582aa47ULL,
- 0x4ad64994d625e4daULL, 0x300e395ce6106da3ULL, 0xbf66a804b64ef628ULL,
- 0xc5bed8cc867b7f51ULL, 0x8aeeace74e645255ULL, 0xf036dc2f7e51db2cULL,
- 0x7f5e4d772e0f40a7ULL, 0x05863dbf1e3ac9deULL, 0xe1fea520be311aafULL,
- 0x9b26d5e88e0493d6ULL, 0x144e44b0de5a085dULL, 0x6e963478ee6f8124ULL,
- 0x21c640532670ac20ULL, 0x5b1e309b16452559ULL, 0xd476a1c3461bbed2ULL,
- 0xaeaed10b762e37abULL, 0x37deb6af5e9b8b5bULL, 0x4d06c6676eae0222ULL,
- 0xc26e573f3ef099a9ULL, 0xb8b627f70ec510d0ULL, 0xf7e653dcc6da3dd4ULL,
- 0x8d3e2314f6efb4adULL, 0x0256b24ca6b12f26ULL, 0x788ec2849684a65fULL,
- 0x9cf65a1b368f752eULL, 0xe62e2ad306bafc57ULL, 0x6946bb8b56e467dcULL,
- 0x139ecb4366d1eea5ULL, 0x5ccebf68aecec3a1ULL, 0x2616cfa09efb4ad8ULL,
- 0xa97e5ef8cea5d153ULL, 0xd3a62e30fe90582aULL, 0xb0c7b7e3c7593bd8ULL,
- 0xca1fc72bf76cb2a1ULL, 0x45775673a732292aULL, 0x3faf26bb9707a053ULL,
- 0x70ff52905f188d57ULL, 0x0a2722586f2d042eULL, 0x854fb3003f739fa5ULL,
- 0xff97c3c80f4616dcULL, 0x1bef5b57af4dc5adULL, 0x61372b9f9f784cd4ULL,
- 0xee5fbac7cf26d75fULL, 0x9487ca0fff135e26ULL, 0xdbd7be24370c7322ULL,
- 0xa10fceec0739fa5bULL, 0x2e675fb4576761d0ULL, 0x54bf2f7c6752e8a9ULL,
- 0xcdcf48d84fe75459ULL, 0xb71738107fd2dd20ULL, 0x387fa9482f8c46abULL,
- 0x42a7d9801fb9cfd2ULL, 0x0df7adabd7a6e2d6ULL, 0x772fdd63e7936bafULL,
- 0xf8474c3bb7cdf024ULL, 0x829f3cf387f8795dULL, 0x66e7a46c27f3aa2cULL,
- 0x1c3fd4a417c62355ULL, 0x935745fc4798b8deULL, 0xe98f353477ad31a7ULL,
- 0xa6df411fbfb21ca3ULL, 0xdc0731d78f8795daULL, 0x536fa08fdfd90e51ULL,
- 0x29b7d047efec8728ULL
-};
-
#define BITMAP_CHECKSUM_SIZE 8
#define BITMAP_CHECKSUM_BITS BOOST_PP_MUL(BITMAP_CHECKSUM_SIZE, 8)
@@ -164,6 +69,10 @@ VCL_DLLPUBLIC sal_uInt64 SAL_CALL vcl_crc64 (
) SAL_THROW_EXTERN_C();
+
+VCL_DLLPUBLIC const sal_uInt64* vcl_get_crc64_table();
+
+
#ifdef __cplusplus
}
#endif
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index d339158..30ef71f 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -514,7 +514,7 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType&
OUString FragShader("areaHashCRC64TFragmentShader");
static const OpenGLTexture aCRCTableTexture(512, 1, GL_RGBA, GL_UNSIGNED_BYTE,
- (sal_uInt8*)(vcl_crc64Table));
+ (sal_uInt8*)(vcl_get_crc64_table()));
// First Pass
diff --git a/vcl/source/bitmap/checksum.cxx b/vcl/source/bitmap/checksum.cxx
index 46042b0..3c9a8a6 100644
--- a/vcl/source/bitmap/checksum.cxx
+++ b/vcl/source/bitmap/checksum.cxx
@@ -20,6 +20,101 @@
#include <sal/types.h>
#include <vcl/checksum.hxx>
+
+/*========================================================================
+ *
+ * vcl_crc64Table (CRC polynomial 0x95AC9329AC4BC9B5ULL).
+ *
+ *======================================================================*/
+static const sal_uInt64 vcl_crc64Table[256] = {
+ 0x0000000000000000ULL, 0x7ad870c830358979ULL, 0xf5b0e190606b12f2ULL,
+ 0x8f689158505e9b8bULL, 0xc038e5739841b68fULL, 0xbae095bba8743ff6ULL,
+ 0x358804e3f82aa47dULL, 0x4f50742bc81f2d04ULL, 0xab28ecb46814fe75ULL,
+ 0xd1f09c7c5821770cULL, 0x5e980d24087fec87ULL, 0x24407dec384a65feULL,
+ 0x6b1009c7f05548faULL, 0x11c8790fc060c183ULL, 0x9ea0e857903e5a08ULL,
+ 0xe478989fa00bd371ULL, 0x7d08ff3b88be6f81ULL, 0x07d08ff3b88be6f8ULL,
+ 0x88b81eabe8d57d73ULL, 0xf2606e63d8e0f40aULL, 0xbd301a4810ffd90eULL,
+ 0xc7e86a8020ca5077ULL, 0x4880fbd87094cbfcULL, 0x32588b1040a14285ULL,
+ 0xd620138fe0aa91f4ULL, 0xacf86347d09f188dULL, 0x2390f21f80c18306ULL,
+ 0x594882d7b0f40a7fULL, 0x1618f6fc78eb277bULL, 0x6cc0863448deae02ULL,
+ 0xe3a8176c18803589ULL, 0x997067a428b5bcf0ULL, 0xfa11fe77117cdf02ULL,
+ 0x80c98ebf2149567bULL, 0x0fa11fe77117cdf0ULL, 0x75796f2f41224489ULL,
+ 0x3a291b04893d698dULL, 0x40f16bccb908e0f4ULL, 0xcf99fa94e9567b7fULL,
+ 0xb5418a5cd963f206ULL, 0x513912c379682177ULL, 0x2be1620b495da80eULL,
+ 0xa489f35319033385ULL, 0xde51839b2936bafcULL, 0x9101f7b0e12997f8ULL,
+ 0xebd98778d11c1e81ULL, 0x64b116208142850aULL, 0x1e6966e8b1770c73ULL,
+ 0x8719014c99c2b083ULL, 0xfdc17184a9f739faULL, 0x72a9e0dcf9a9a271ULL,
+ 0x08719014c99c2b08ULL, 0x4721e43f0183060cULL, 0x3df994f731b68f75ULL,
+ 0xb29105af61e814feULL, 0xc849756751dd9d87ULL, 0x2c31edf8f1d64ef6ULL,
+ 0x56e99d30c1e3c78fULL, 0xd9810c6891bd5c04ULL, 0xa3597ca0a188d57dULL,
+ 0xec09088b6997f879ULL, 0x96d1784359a27100ULL, 0x19b9e91b09fcea8bULL,
+ 0x636199d339c963f2ULL, 0xdf7adabd7a6e2d6fULL, 0xa5a2aa754a5ba416ULL,
+ 0x2aca3b2d1a053f9dULL, 0x50124be52a30b6e4ULL, 0x1f423fcee22f9be0ULL,
+ 0x659a4f06d21a1299ULL, 0xeaf2de5e82448912ULL, 0x902aae96b271006bULL,
+ 0x74523609127ad31aULL, 0x0e8a46c1224f5a63ULL, 0x81e2d7997211c1e8ULL,
+ 0xfb3aa75142244891ULL, 0xb46ad37a8a3b6595ULL, 0xceb2a3b2ba0eececULL,
+ 0x41da32eaea507767ULL, 0x3b024222da65fe1eULL, 0xa2722586f2d042eeULL,
+ 0xd8aa554ec2e5cb97ULL, 0x57c2c41692bb501cULL, 0x2d1ab4dea28ed965ULL,
+ 0x624ac0f56a91f461ULL, 0x1892b03d5aa47d18ULL, 0x97fa21650afae693ULL,
+ 0xed2251ad3acf6feaULL, 0x095ac9329ac4bc9bULL, 0x7382b9faaaf135e2ULL,
+ 0xfcea28a2faafae69ULL, 0x8632586aca9a2710ULL, 0xc9622c4102850a14ULL,
+ 0xb3ba5c8932b0836dULL, 0x3cd2cdd162ee18e6ULL, 0x460abd1952db919fULL,
+ 0x256b24ca6b12f26dULL, 0x5fb354025b277b14ULL, 0xd0dbc55a0b79e09fULL,
+ 0xaa03b5923b4c69e6ULL, 0xe553c1b9f35344e2ULL, 0x9f8bb171c366cd9bULL,
+ 0x10e3202993385610ULL, 0x6a3b50e1a30ddf69ULL, 0x8e43c87e03060c18ULL,
+ 0xf49bb8b633338561ULL, 0x7bf329ee636d1eeaULL, 0x012b592653589793ULL,
+ 0x4e7b2d0d9b47ba97ULL, 0x34a35dc5ab7233eeULL, 0xbbcbcc9dfb2ca865ULL,
+ 0xc113bc55cb19211cULL, 0x5863dbf1e3ac9decULL, 0x22bbab39d3991495ULL,
+ 0xadd33a6183c78f1eULL, 0xd70b4aa9b3f20667ULL, 0x985b3e827bed2b63ULL,
+ 0xe2834e4a4bd8a21aULL, 0x6debdf121b863991ULL, 0x1733afda2bb3b0e8ULL,
+ 0xf34b37458bb86399ULL, 0x8993478dbb8deae0ULL, 0x06fbd6d5ebd3716bULL,
+ 0x7c23a61ddbe6f812ULL, 0x3373d23613f9d516ULL, 0x49aba2fe23cc5c6fULL,
+ 0xc6c333a67392c7e4ULL, 0xbc1b436e43a74e9dULL, 0x95ac9329ac4bc9b5ULL,
+ 0xef74e3e19c7e40ccULL, 0x601c72b9cc20db47ULL, 0x1ac40271fc15523eULL,
+ 0x5594765a340a7f3aULL, 0x2f4c0692043ff643ULL, 0xa02497ca54616dc8ULL,
+ 0xdafce7026454e4b1ULL, 0x3e847f9dc45f37c0ULL, 0x445c0f55f46abeb9ULL,
+ 0xcb349e0da4342532ULL, 0xb1eceec59401ac4bULL, 0xfebc9aee5c1e814fULL,
+ 0x8464ea266c2b0836ULL, 0x0b0c7b7e3c7593bdULL, 0x71d40bb60c401ac4ULL,
+ 0xe8a46c1224f5a634ULL, 0x927c1cda14c02f4dULL, 0x1d148d82449eb4c6ULL,
+ 0x67ccfd4a74ab3dbfULL, 0x289c8961bcb410bbULL, 0x5244f9a98c8199c2ULL,
+ 0xdd2c68f1dcdf0249ULL, 0xa7f41839ecea8b30ULL, 0x438c80a64ce15841ULL,
+ 0x3954f06e7cd4d138ULL, 0xb63c61362c8a4ab3ULL, 0xcce411fe1cbfc3caULL,
+ 0x83b465d5d4a0eeceULL, 0xf96c151de49567b7ULL, 0x76048445b4cbfc3cULL,
+ 0x0cdcf48d84fe7545ULL, 0x6fbd6d5ebd3716b7ULL, 0x15651d968d029fceULL,
+ 0x9a0d8ccedd5c0445ULL, 0xe0d5fc06ed698d3cULL, 0xaf85882d2576a038ULL,
+ 0xd55df8e515432941ULL, 0x5a3569bd451db2caULL, 0x20ed197575283bb3ULL,
+ 0xc49581ead523e8c2ULL, 0xbe4df122e51661bbULL, 0x3125607ab548fa30ULL,
+ 0x4bfd10b2857d7349ULL, 0x04ad64994d625e4dULL, 0x7e7514517d57d734ULL,
+ 0xf11d85092d094cbfULL, 0x8bc5f5c11d3cc5c6ULL, 0x12b5926535897936ULL,
+ 0x686de2ad05bcf04fULL, 0xe70573f555e26bc4ULL, 0x9ddd033d65d7e2bdULL,
+ 0xd28d7716adc8cfb9ULL, 0xa85507de9dfd46c0ULL, 0x273d9686cda3dd4bULL,
+ 0x5de5e64efd965432ULL, 0xb99d7ed15d9d8743ULL, 0xc3450e196da80e3aULL,
+ 0x4c2d9f413df695b1ULL, 0x36f5ef890dc31cc8ULL, 0x79a59ba2c5dc31ccULL,
+ 0x037deb6af5e9b8b5ULL, 0x8c157a32a5b7233eULL, 0xf6cd0afa9582aa47ULL,
+ 0x4ad64994d625e4daULL, 0x300e395ce6106da3ULL, 0xbf66a804b64ef628ULL,
+ 0xc5bed8cc867b7f51ULL, 0x8aeeace74e645255ULL, 0xf036dc2f7e51db2cULL,
+ 0x7f5e4d772e0f40a7ULL, 0x05863dbf1e3ac9deULL, 0xe1fea520be311aafULL,
+ 0x9b26d5e88e0493d6ULL, 0x144e44b0de5a085dULL, 0x6e963478ee6f8124ULL,
+ 0x21c640532670ac20ULL, 0x5b1e309b16452559ULL, 0xd476a1c3461bbed2ULL,
+ 0xaeaed10b762e37abULL, 0x37deb6af5e9b8b5bULL, 0x4d06c6676eae0222ULL,
+ 0xc26e573f3ef099a9ULL, 0xb8b627f70ec510d0ULL, 0xf7e653dcc6da3dd4ULL,
+ 0x8d3e2314f6efb4adULL, 0x0256b24ca6b12f26ULL, 0x788ec2849684a65fULL,
+ 0x9cf65a1b368f752eULL, 0xe62e2ad306bafc57ULL, 0x6946bb8b56e467dcULL,
+ 0x139ecb4366d1eea5ULL, 0x5ccebf68aecec3a1ULL, 0x2616cfa09efb4ad8ULL,
+ 0xa97e5ef8cea5d153ULL, 0xd3a62e30fe90582aULL, 0xb0c7b7e3c7593bd8ULL,
+ 0xca1fc72bf76cb2a1ULL, 0x45775673a732292aULL, 0x3faf26bb9707a053ULL,
+ 0x70ff52905f188d57ULL, 0x0a2722586f2d042eULL, 0x854fb3003f739fa5ULL,
+ 0xff97c3c80f4616dcULL, 0x1bef5b57af4dc5adULL, 0x61372b9f9f784cd4ULL,
+ 0xee5fbac7cf26d75fULL, 0x9487ca0fff135e26ULL, 0xdbd7be24370c7322ULL,
+ 0xa10fceec0739fa5bULL, 0x2e675fb4576761d0ULL, 0x54bf2f7c6752e8a9ULL,
+ 0xcdcf48d84fe75459ULL, 0xb71738107fd2dd20ULL, 0x387fa9482f8c46abULL,
+ 0x42a7d9801fb9cfd2ULL, 0x0df7adabd7a6e2d6ULL, 0x772fdd63e7936bafULL,
+ 0xf8474c3bb7cdf024ULL, 0x829f3cf387f8795dULL, 0x66e7a46c27f3aa2cULL,
+ 0x1c3fd4a417c62355ULL, 0x935745fc4798b8deULL, 0xe98f353477ad31a7ULL,
+ 0xa6df411fbfb21ca3ULL, 0xdc0731d78f8795daULL, 0x536fa08fdfd90e51ULL,
+ 0x29b7d047efec8728ULL
+};
+
/*========================================================================
*
* vcl_crc64 implementation.
@@ -29,7 +124,7 @@
(vcl_crc64Table[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8))
/*
- * rtl_crc64.
+ * vcl_crc64.
*/
sal_uInt64 SAL_CALL vcl_crc64 (
sal_uInt64 Crc,
@@ -48,4 +143,12 @@ sal_uInt64 SAL_CALL vcl_crc64 (
return Crc;
}
+/*
+ * vcl_get_crc64_table.
+ */
+const sal_uInt64* vcl_get_crc64_table()
+{
+ return vcl_crc64Table;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 8ec9b87678c9fea437c5bdd623758d850fa8d309
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Tue Sep 1 14:11:34 2015 +0200
Modified CRC test in order to fix test failure on OSX
Change-Id: Ic3fa76557746242ca99e3ce63ea73ec1d2b11f50
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index b5c121a..28dd9c2 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -173,6 +173,7 @@ void BitmapTest::testCRC()
checkAndInsert(aCRCs, aBitmap, "white bitmap");
ScopedVclPtrInstance<VirtualDevice> aVDev;
+ aVDev->SetBackground(Wallpaper(COL_WHITE));
aVDev->SetOutputSizePixel(Size(1023, 759));
Bitmap aWhiteCheck = getAsBitmap(aVDev);
CPPUNIT_ASSERT(aCRCs.find(aWhiteCheck.GetChecksum()) != aCRCs.end());
commit 80eb87f3c9a8e650070f85cfbc796422ae6840a5
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Tue Sep 1 10:27:47 2015 +0200
Changed DLL macro for fixing warning C4273 on Windows
Change-Id: I50e4b30e0932f092db9e7d60e50f88f2b7e83895
diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 6efb4ac..8b14954 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -22,9 +22,9 @@
#define INCLUDED_VCL_INC_CHECKSUM_HXX
#include <sal/config.h>
-#include <sal/saldllapi.h>
#include <sal/types.h>
#include <tools/solar.h>
+#include <vcl/dllapi.h>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/arithmetic/mul.hpp>
@@ -158,7 +158,7 @@ extern "C" {
@param DatLen [in] data buffer length.
@return new CRC64 value.
*/
-SAL_DLLPUBLIC sal_uInt64 SAL_CALL vcl_crc64 (
+VCL_DLLPUBLIC sal_uInt64 SAL_CALL vcl_crc64 (
sal_uInt64 Crc,
const void *Data, sal_uInt32 DatLen
) SAL_THROW_EXTERN_C();
commit 2d215ceccfb6476550ea389e19ab4c84b685ce97
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Mon Aug 31 23:04:55 2015 +0200
Fixed a bug due to conflicts with Casarin's commit.
Change-Id: I5226a55ba804d494a8c9c9c9b5cd7ed3889eafbf
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 62b9f29..72aeb4d 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1415,7 +1415,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
// <g id="?" > (used by animations)
{
// embedded bitmap id
- const sal_uInt32 nId = SVGActionWriter::GetChecksum( pAction );
+ nId = SVGActionWriter::GetChecksum( pAction );
sId = "embedded-bitmap(";
sId += msShapeId;
sId += ".";
commit 07254e701fe8cbb7babbfaaf1f096b1afbd5eaf2
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Mon Jul 13 15:38:09 2015 +0100
tdf#93532 - Bitmap CRC unit tests.
Change-Id: Ic75801d7ad941ba802ffe418d5c666b1e7b0e94f
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 306b0df..b5c121a 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -12,9 +12,13 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
+#include <unordered_map>
+
#include <vcl/bitmap.hxx>
#include <vcl/bmpacc.hxx>
+#include <vcl/virdev.hxx>
+#include <rtl/strbuf.hxx>
#include <tools/stream.hxx>
#include <vcl/graphicfilter.hxx>
@@ -27,10 +31,12 @@ class BitmapTest : public CppUnit::TestFixture
{
void testConvert();
void testScale();
+ void testCRC();
CPPUNIT_TEST_SUITE(BitmapTest);
CPPUNIT_TEST(testConvert);
CPPUNIT_TEST(testScale);
+ CPPUNIT_TEST(testCRC);
CPPUNIT_TEST_SUITE_END();
};
@@ -129,6 +135,56 @@ void BitmapTest::testScale()
}
}
+typedef std::unordered_map<sal_uInt64, const char *> CRCHash;
+
+void checkAndInsert(CRCHash &rHash, sal_uInt64 nCRC, const char *pLocation)
+{
+ auto it = rHash.find(nCRC);
+ if (it != rHash.end()) {
+ OStringBuffer aBuf("CRC collision between ");
+ aBuf.append(pLocation);
+ aBuf.append(" and ");
+ aBuf.append(it->second);
+ aBuf.append(" hash is 0x");
+ aBuf.append((sal_Int64)nCRC, 16);
+ CPPUNIT_FAIL(aBuf.toString().getStr());
+ }
+ rHash[nCRC] = pLocation;
+}
+
+void checkAndInsert(CRCHash &rHash, Bitmap rBmp, const char *pLocation)
+{
+ checkAndInsert(rHash, rBmp.GetChecksum(), pLocation);
+}
+
+Bitmap getAsBitmap(VclPtr<OutputDevice> pOut)
+{
+ return pOut->GetBitmap(Point(), pOut->GetOutputSizePixel());
+}
+
+void BitmapTest::testCRC()
+{
+ CRCHash aCRCs;
+
+ Bitmap aBitmap(Size(1023,759), 24, 0);
+ aBitmap.Erase(COL_BLACK);
+ checkAndInsert(aCRCs, aBitmap, "black bitmap");
+ aBitmap.Invert();
+ checkAndInsert(aCRCs, aBitmap, "white bitmap");
+
+ ScopedVclPtrInstance<VirtualDevice> aVDev;
+ aVDev->SetOutputSizePixel(Size(1023, 759));
+ Bitmap aWhiteCheck = getAsBitmap(aVDev);
+ CPPUNIT_ASSERT(aCRCs.find(aWhiteCheck.GetChecksum()) != aCRCs.end());
+
+ // a 1x1 black & white checkerboard
+ aVDev->DrawCheckered(Point(), aVDev->GetOutputSizePixel(), 1, 1);
+ Bitmap aChecker = getAsBitmap(aVDev);
+ checkAndInsert(aCRCs, aChecker, "checkerboard");
+ aChecker.Invert();
+ checkAndInsert(aCRCs, aChecker, "inverted checkerboard");
+}
+
} // namespace
CPPUNIT_TEST_SUITE_REGISTRATION(BitmapTest);
commit d3dbbf0944785e5dcd5d8c735c7360cc51a3b0d0
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Mon Aug 31 14:35:50 2015 +0200
Removed no more needed code in ImpBitmap::ImplGetChecksu
Change-Id: I647941591615733caa546a8710817616923afa85
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index baf2191..b79b0d4 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -96,8 +96,7 @@ BitmapChecksum ImpBitmap::ImplGetChecksum() const
{
SalBitmap::ChecksumType aChecksum;
mpSalBitmap->GetChecksum(aChecksum);
- BitmapChecksum a32BitChecksum = aChecksum;
- return a32BitChecksum;
+ return aChecksum;
}
void ImpBitmap::ImplInvalidateChecksum()
commit 51242678e2132d2172b9a63125a0974044baf8aa
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Aug 31 14:09:33 2015 +0200
filter: avoid casting BitmapChecksum to sal_uInt32
Since BitmapChecksum is a typedef for sal_uInt64.
Change-Id: I768fa5134fa6e86559f3c6cbe1071093b4e68152
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 75ccb45..1773740 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1302,7 +1302,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps()
MetaAction* pAction = aMtf.GetAction( 0 );
if( pAction )
{
- sal_uInt32 nId = (sal_uInt32)(GetBitmapChecksum( pAction ));
+ BitmapChecksum nId = GetBitmapChecksum( pAction );
sId = "bitmap(" + OUString::number( nId ) + ")";
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index c6665bc..62b9f29 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1359,7 +1359,7 @@ void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction
}
// bitmap placeholder element
- sal_uInt32 nId = SVGActionWriter::GetChecksum( pAction );
+ BitmapChecksum nId = SVGActionWriter::GetChecksum( pAction );
OUString sId = "bitmap-placeholder(" + msShapeId + "." +
OUString::number( nId ) + ")";
@@ -1381,7 +1381,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
const GDIMetaFile& rMtf = *mpTextEmbeddedBitmapMtf;
OUString sId, sRefId;
- sal_uInt32 nId, nChecksum = 0;
+ BitmapChecksum nId, nChecksum = 0;
Point aPt;
Size aSz;
sal_uLong nCount = rMtf.GetActionSize();
@@ -1396,7 +1396,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
case( MetaActionType::BMPSCALE ):
{
const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pAction);
- nChecksum = (sal_uInt32)(pA->GetBitmap().GetChecksum());
+ nChecksum = pA->GetBitmap().GetChecksum();
aPt = pA->GetPoint();
aSz = pA->GetSize();
}
@@ -1404,7 +1404,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
case( MetaActionType::BMPEXSCALE ):
{
const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction);
- nChecksum = (sal_uInt32)(pA->GetBitmapEx().GetChecksum());
+ nChecksum = pA->GetBitmapEx().GetChecksum();
aPt = pA->GetPoint();
aSz = pA->GetSize();
}
@@ -1779,13 +1779,13 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
return aPathData;
}
-sal_uInt32 SVGActionWriter::GetChecksum( const MetaAction* pAction )
+BitmapChecksum SVGActionWriter::GetChecksum( const MetaAction* pAction )
{
GDIMetaFile aMtf;
MetaAction* pA = const_cast<MetaAction*>(pAction);
pA->Duplicate();
aMtf.AddAction( pA );
- return (sal_uInt32)(aMtf.GetChecksum());
+ return aMtf.GetChecksum();
}
void SVGActionWriter::ImplWriteLine( const Point& rPt1, const Point& rPt2,
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index e96e516..6251dda 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -357,7 +357,7 @@ private:
public:
static OUString GetPathString( const tools::PolyPolygon& rPolyPoly, bool bLine );
- static sal_uInt32 GetChecksum( const MetaAction* pAction );
+ static BitmapChecksum GetChecksum( const MetaAction* pAction );
public:
commit d9096da5413984cfa65151f9dbdcc5da271c74a1
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Mon Aug 31 13:55:52 2015 +0200
Fixed a bug the 64-bit checksum switch code was affected by
Changed the size of the string buffer used for converting 4 integer
values into a hexadecimal string:
aHexStr.setLength(24 + (2 * BITMAP_CHECKSUM_SIZE))
Change-Id: I5936bae4ce3b41e85a68f6f342b5288f7f9395fe
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 6c09910..59bbeb2 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -123,7 +123,7 @@ OString GraphicID::GetIDString() const
{
OStringBuffer aHexStr;
sal_Int32 nShift, nIndex = 0;
- aHexStr.setLength(32);
+ aHexStr.setLength(24 + (2 * BITMAP_CHECKSUM_SIZE));
for( nShift = 28; nShift >= 0; nShift -= 4 )
aHexStr[nIndex++] = aHexData[ ( mnID1 >> (sal_uInt32) nShift ) & 0xf ];
commit 2d860a8cef3ee887ac5cad1bc67b0f820a63b78d
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Sat Aug 29 14:30:56 2015 +0200
switch to 64-bit checksum: fixed a missed substitution
Change-Id: I733240798a8415602b824a9732193c344fe53a5c
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 25ae4f4..6c09910 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -79,7 +79,7 @@ GraphicID::GraphicID( const GraphicObject& rObj )
mnID1 |= rSvgDataPtr->getSvgDataArrayLength();
mnID2 = basegfx::fround(rRange.getWidth());
mnID3 = basegfx::fround(rRange.getHeight());
- mnID4 = rtl_crc32(0, rSvgDataPtr->getSvgDataArray().get(), rSvgDataPtr->getSvgDataArrayLength());
+ mnID4 = vcl_get_checksum(0, rSvgDataPtr->getSvgDataArray().get(), rSvgDataPtr->getSvgDataArrayLength());
}
else if( rGraphic.IsAnimated() )
{
commit c8a46ee5199f42f1f888d5bee765da83a608918f
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Sat Aug 29 14:28:34 2015 +0200
truncate checksum to 32-bit when it slips inside a file stream
Change-Id: I2cedf8acf73f71529f4090ff2f9fce7ab7663e68
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 1773740..75ccb45 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1302,7 +1302,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps()
MetaAction* pAction = aMtf.GetAction( 0 );
if( pAction )
{
- BitmapChecksum nId = GetBitmapChecksum( pAction );
+ sal_uInt32 nId = (sal_uInt32)(GetBitmapChecksum( pAction ));
sId = "bitmap(" + OUString::number( nId ) + ")";
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 62b9f29..c6665bc 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1359,7 +1359,7 @@ void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction
}
// bitmap placeholder element
- BitmapChecksum nId = SVGActionWriter::GetChecksum( pAction );
+ sal_uInt32 nId = SVGActionWriter::GetChecksum( pAction );
OUString sId = "bitmap-placeholder(" + msShapeId + "." +
OUString::number( nId ) + ")";
@@ -1381,7 +1381,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
const GDIMetaFile& rMtf = *mpTextEmbeddedBitmapMtf;
OUString sId, sRefId;
- BitmapChecksum nId, nChecksum = 0;
+ sal_uInt32 nId, nChecksum = 0;
Point aPt;
Size aSz;
sal_uLong nCount = rMtf.GetActionSize();
@@ -1396,7 +1396,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
case( MetaActionType::BMPSCALE ):
{
const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pAction);
- nChecksum = pA->GetBitmap().GetChecksum();
+ nChecksum = (sal_uInt32)(pA->GetBitmap().GetChecksum());
aPt = pA->GetPoint();
aSz = pA->GetSize();
}
@@ -1404,7 +1404,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
case( MetaActionType::BMPEXSCALE ):
{
const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction);
- nChecksum = pA->GetBitmapEx().GetChecksum();
+ nChecksum = (sal_uInt32)(pA->GetBitmapEx().GetChecksum());
aPt = pA->GetPoint();
aSz = pA->GetSize();
}
@@ -1779,13 +1779,13 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
return aPathData;
}
-BitmapChecksum SVGActionWriter::GetChecksum( const MetaAction* pAction )
+sal_uInt32 SVGActionWriter::GetChecksum( const MetaAction* pAction )
{
GDIMetaFile aMtf;
MetaAction* pA = const_cast<MetaAction*>(pAction);
pA->Duplicate();
aMtf.AddAction( pA );
- return aMtf.GetChecksum();
+ return (sal_uInt32)(aMtf.GetChecksum());
}
void SVGActionWriter::ImplWriteLine( const Point& rPt1, const Point& rPt2,
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index 280bd52..e96e516 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -357,7 +357,7 @@ private:
public:
static OUString GetPathString( const tools::PolyPolygon& rPolyPoly, bool bLine );
- static BitmapChecksum GetChecksum( const MetaAction* pAction );
+ static sal_uInt32 GetChecksum( const MetaAction* pAction );
public:
commit 31ae4863782b4dfb07573bb96124bb03e44837a7
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Sat Aug 29 10:27:21 2015 +0200
gl-checksum: added a minimum size check for using GL version
(nWidth * nHeight) < (1024*768) || nWidth < 128 || nHeight < 128
Change-Id: Iedda6a333958c76c19b837890eb3fa28e631bc90
diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index b33d69f..0e0b0e5 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -55,7 +55,7 @@ private:
void makeCurrent();
virtual void updateChecksum() const;
- bool calcChecksumGL(OpenGLTexture& rHashTexture, ChecksumType& rHash) const;
+ bool calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& rChecksum) const;
public:
OpenGLSalBitmap();
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 2b141ca..d339158 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -594,7 +594,18 @@ void OpenGLSalBitmap::updateChecksum() const
pThis->CreateTexture();
}
- pThis->mbChecksumValid = calcChecksumGL(pThis->maTexture, pThis->mnChecksum);
+ OpenGLTexture& rInputTexture = pThis->maTexture;
+ int nWidth = rInputTexture.GetWidth();
+ int nHeight = rInputTexture.GetHeight();
+
+ if( (nWidth * nHeight) < (1024*768) || nWidth < 128 || nHeight < 128 )
+ {
+ SalBitmap::updateChecksum();
+ }
+ else
+ {
+ pThis->mbChecksumValid = calcChecksumGL(rInputTexture, pThis->mnChecksum);
+ }
}
OpenGLContext* OpenGLSalBitmap::GetBitmapContext()
commit 33f57c485ce21964c9500f3a3d741f655fa5f371
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Fri Aug 28 15:35:43 2015 +0200
switch to 64-bit checksum: now BitmapChecksum is a sal_uInt64
Changed hardcoded checksum value in ooxmlimport unit test (testN777345).
Change-Id: Ied43bf626be82c0e7f6c62e965d0704fc645ac19
diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 83facef..6efb4ac 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -125,11 +125,10 @@ static const sal_uInt64 vcl_crc64Table[256] = {
0x29b7d047efec8728ULL
};
-#define BITMAP_CHECKSUM_SIZE 4
+#define BITMAP_CHECKSUM_SIZE 8
#define BITMAP_CHECKSUM_BITS BOOST_PP_MUL(BITMAP_CHECKSUM_SIZE, 8)
-typedef sal_uLong BitmapChecksum;
-
+typedef sal_uInt64 BitmapChecksum;
typedef sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE];
#define BITMAP_CHECKSUM_SET_OCTET(z, i, unused) \
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 625ec12..a32dd90 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -750,7 +750,7 @@ DECLARE_OOXMLIMPORT_TEST(testN777345, "n777345.docx")
Graphic aGraphic(xGraphic);
// If this changes later, feel free to update it, but make sure it's not
// the checksum of a white/transparent placeholder rectangle.
- CPPUNIT_ASSERT_EQUAL(sal_uLong(1256330431U), aGraphic.GetChecksum());
+ CPPUNIT_ASSERT_EQUAL(BitmapChecksum(3652741777587093783), aGraphic.GetChecksum());
#endif
}
commit 9644b6c8c368d27a601d905e998ee9b6f27dbc9c
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Aug 27 21:28:48 2015 +0100
CRC is an integer type -> mnChecksum.
Change-Id: I9e4d36105a59c5f81677d8e062106dae6f709464
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index 0815aee..003a63a 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -71,7 +71,7 @@ public:
{
updateChecksum();
assert(mbChecksumValid);
- rChecksum = maChecksum;
+ rChecksum = mnChecksum;
return mbChecksumValid;
}
@@ -81,8 +81,8 @@ public:
}
protected:
- ChecksumType maChecksum;
- bool mbChecksumValid;
+ ChecksumType mnChecksum;
+ bool mbChecksumValid;
protected:
virtual void updateChecksum() const
@@ -97,7 +97,7 @@ protected:
{
nCrc = vcl_get_checksum(0, pBuf->mpBits, pBuf->mnScanlineSize * pBuf->mnHeight);
pThis->ReleaseBuffer(pBuf, BITMAP_READ_ACCESS);
- pThis->maChecksum = nCrc;
+ pThis->mnChecksum = nCrc;
pThis->mbChecksumValid = true;
}
else
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index db0e803..2b141ca 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -594,7 +594,7 @@ void OpenGLSalBitmap::updateChecksum() const
pThis->CreateTexture();
}
- pThis->mbChecksumValid = calcChecksumGL(pThis->maTexture, pThis->maChecksum);
+ pThis->mbChecksumValid = calcChecksumGL(pThis->maTexture, pThis->mnChecksum);
}
OpenGLContext* OpenGLSalBitmap::GetBitmapContext()
commit 8ecd142d32334d0180d4d0bcee00b0f0e15a3e45
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Aug 27 21:27:16 2015 +0100
fix: buffer was released before getting checksum.
g
Conflicts:
vcl/inc/salbmp.hxx
Change-Id: I57d1e4b8e4909ce0b82c9e61ca271768cc73cd8b
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index f8e68f4..0815aee 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -95,8 +95,8 @@ protected:
BitmapBuffer* pBuf = pThis->AcquireBuffer(BITMAP_READ_ACCESS);
if (pBuf)
{
- pThis->ReleaseBuffer(pBuf, BITMAP_READ_ACCESS);
nCrc = vcl_get_checksum(0, pBuf->mpBits, pBuf->mnScanlineSize * pBuf->mnHeight);
+ pThis->ReleaseBuffer(pBuf, BITMAP_READ_ACCESS);
pThis->maChecksum = nCrc;
pThis->mbChecksumValid = true;
}
commit 209951a8ae71ae38d57457a5a85005be8f46dcdf
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Thu Aug 27 22:57:15 2015 +0200
switch to 64-bit checksum: conversion from BitmapChecksum to an octet array
Defined BitmapChecksumOctetArray which is an array of bytes whose size
is the same of BitmapChecksum.
Defined a routine for converting a BitmapChecksum into a
BitmapChecksumOctetArray.
Change-Id: I70d17ab8b841795ae27c60b418d6b090bff604bb
diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 2987fda..83facef 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -26,6 +26,11 @@
#include <sal/types.h>
#include <tools/solar.h>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/mul.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+
+
/*========================================================================
*
* vcl_crc64Table (CRC polynomial 0x95AC9329AC4BC9B5ULL).
@@ -120,9 +125,21 @@ static const sal_uInt64 vcl_crc64Table[256] = {
0x29b7d047efec8728ULL
};
-typedef sal_uLong BitmapChecksum;
+#define BITMAP_CHECKSUM_SIZE 4
+#define BITMAP_CHECKSUM_BITS BOOST_PP_MUL(BITMAP_CHECKSUM_SIZE, 8)
+
+typedef sal_uLong BitmapChecksum;
+
+typedef sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE];
-#define BITMAP_CHECKSUM_BITS (sizeof(BitmapChecksum) * 8)
+#define BITMAP_CHECKSUM_SET_OCTET(z, i, unused) \
+p[i] = (sal_uInt8)(n >> BOOST_PP_MUL(8, i));
+
+
+inline void BCToBCOA( BitmapChecksum n , BitmapChecksumOctetArray p )
+{
+ BOOST_PP_REPEAT(BITMAP_CHECKSUM_SIZE , BITMAP_CHECKSUM_SET_OCTET, unused)
+}
#ifdef __cplusplus
extern "C" {
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index c5803e4..4e5b333 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -209,6 +209,7 @@ sal_uLong Animation::GetSizeBytes() const
BitmapChecksum Animation::GetChecksum() const
{
SVBT32 aBT32;
+ BitmapChecksumOctetArray aBCOA;
BitmapChecksum nCrc = GetBitmapEx().GetChecksum();
UInt32ToSVBT32( maList.size(), aBT32 );
@@ -225,8 +226,8 @@ BitmapChecksum Animation::GetChecksum() const
for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
{
- UInt32ToSVBT32( maList[ i ]->GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( maList[ i ]->GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
}
return nCrc;
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index ab935d2..02c29e2 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -312,6 +312,7 @@ BitmapChecksum BitmapEx::GetChecksum() const
{
BitmapChecksum nCrc = aBitmap.GetChecksum();
SVBT32 aBT32;
+ BitmapChecksumOctetArray aBCOA;
UInt32ToSVBT32( (long) eTransparent, aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -321,8 +322,8 @@ BitmapChecksum BitmapEx::GetChecksum() const
if( ( TRANSPARENT_BITMAP == eTransparent ) && !aMask.IsEmpty() )
{
- UInt32ToSVBT32( aMask.GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( aMask.GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
}
return nCrc;
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index d69914e..3201a72 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2342,12 +2342,13 @@ GDIMetaFile GDIMetaFile::GetMonochromeMtf( const Color& rColor ) const
BitmapChecksum GDIMetaFile::GetChecksum() const
{
- GDIMetaFile aMtf;
- SvMemoryStream aMemStm( 65535, 65535 );
- ImplMetaWriteData aWriteData;
- SVBT16 aBT16;
- SVBT32 aBT32;
- BitmapChecksum nCrc = 0;
+ GDIMetaFile aMtf;
+ SvMemoryStream aMemStm( 65535, 65535 );
+ ImplMetaWriteData aWriteData;
+ SVBT16 aBT16;
+ SVBT32 aBT32;
+ BitmapChecksumOctetArray aBCOA;
+ BitmapChecksum nCrc = 0;
aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
for( size_t i = 0, nObjCount = GetActionSize(); i < nObjCount; i++ )
@@ -2363,8 +2364,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2381,8 +2382,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2405,8 +2406,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetDestPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2441,8 +2442,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmapEx().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2459,8 +2460,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmapEx().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2483,8 +2484,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmapEx().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetDestPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2519,8 +2520,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2540,8 +2541,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2567,8 +2568,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
commit b545728fddad2e70b6a38515b60455fc229e63af
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Thu Aug 27 17:09:36 2015 +0200
vcl_get_checksum wraps the call to the real checksum function
Change-Id: I72916f18966756ecc99e77f1b164e99377eb456e
diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 53c2f16..2987fda 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -152,6 +152,15 @@ SAL_DLLPUBLIC sal_uInt64 SAL_CALL vcl_crc64 (
}
#endif
+inline BitmapChecksum vcl_get_checksum (
+ BitmapChecksum Checksum,
+ const void *Data,
+ sal_uInt32 DatLen
+)
+{
+ return (BitmapChecksum)(vcl_crc64( Checksum, Data, DatLen ));
+}
+
#endif // INCLUDED_VCL_INC_CHECKSUM_HXX
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index a9160e1..f8e68f4 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -39,7 +39,7 @@ class VCL_PLUGIN_PUBLIC SalBitmap
{
public:
- typedef sal_uInt64 ChecksumType;
+ typedef BitmapChecksum ChecksumType;
SalBitmap() : mbChecksumValid(false) {}
virtual ~SalBitmap();
@@ -96,7 +96,7 @@ protected:
if (pBuf)
{
pThis->ReleaseBuffer(pBuf, BITMAP_READ_ACCESS);
- nCrc = vcl_crc64(0, pBuf->mpBits, pBuf->mnScanlineSize * pBuf->mnHeight);
+ nCrc = vcl_get_checksum(0, pBuf->mpBits, pBuf->mnScanlineSize * pBuf->mnHeight);
pThis->maChecksum = nCrc;
pThis->mbChecksumValid = true;
}
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index f4f17ff..db0e803 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -576,7 +576,7 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType&
std::vector<sal_uInt8> aBuf( aFinalTexture.GetWidth() * aFinalTexture.GetHeight() * 4 );
aFinalTexture.Read(GL_RGBA, GL_UNSIGNED_BYTE, aBuf.data());
- ChecksumType nCrc = vcl_crc64(0, aBuf.data(), aBuf.size());
+ ChecksumType nCrc = vcl_get_checksum(0, aBuf.data(), aBuf.size());
rChecksum = nCrc;
return true;
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index cb5c934..c5803e4 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -37,25 +37,25 @@ BitmapChecksum AnimationBitmap::GetChecksum() const
SVBT32 aBT32;
UInt32ToSVBT32( aPosPix.X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( aPosPix.Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( aSizePix.Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( aSizePix.Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( (long) nWait, aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( (long) eDisposal, aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( (long) bUserInput, aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
return nCrc;
}
@@ -212,21 +212,21 @@ BitmapChecksum Animation::GetChecksum() const
BitmapChecksum nCrc = GetBitmapEx().GetChecksum();
UInt32ToSVBT32( maList.size(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( maGlobalSize.Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( maGlobalSize.Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( (long) meCycleMode, aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
{
UInt32ToSVBT32( maList[ i ]->GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
return nCrc;
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 9559e9f..ab935d2 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -314,15 +314,15 @@ BitmapChecksum BitmapEx::GetChecksum() const
SVBT32 aBT32;
UInt32ToSVBT32( (long) eTransparent, aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( (long) bAlpha, aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
if( ( TRANSPARENT_BITMAP == eTransparent ) && !aMask.IsEmpty() )
{
UInt32ToSVBT32( aMask.GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
return nCrc;
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index a4946bb..d69914e 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2361,16 +2361,16 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaBmpAction* pAct = static_cast<MetaBmpAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
@@ -2379,22 +2379,22 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaBmpScaleAction* pAct = static_cast<MetaBmpScaleAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
@@ -2403,34 +2403,34 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaBmpScalePartAction* pAct = static_cast<MetaBmpScalePartAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
@@ -2439,16 +2439,16 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaBmpExAction* pAct = static_cast<MetaBmpExAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
@@ -2457,22 +2457,22 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaBmpExScaleAction* pAct = static_cast<MetaBmpExScaleAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
@@ -2481,34 +2481,34 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaBmpExScalePartAction* pAct = static_cast<MetaBmpExScalePartAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
@@ -2517,19 +2517,19 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaMaskAction* pAct = static_cast<MetaMaskAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
@@ -2538,25 +2538,25 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaMaskScaleAction* pAct = static_cast<MetaMaskScaleAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
@@ -2565,44 +2565,44 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
MetaMaskScalePartAction* pAct = static_cast<MetaMaskScalePartAction*>(pAction);
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
- nCrc = rtl_crc32( nCrc, aBT16, 2 );
+ nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetDestSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcPoint().X(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcPoint().Y(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcSize().Width(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
UInt32ToSVBT32( pAct->GetSrcSize().Height(), aBT32 );
- nCrc = rtl_crc32( nCrc, aBT32, 4 );
+ nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
}
break;
case MetaActionType::EPS :
{
MetaEPSAction* pAct = static_cast<MetaEPSAction*>(pAction);
- nCrc = rtl_crc32( nCrc, pAct->GetLink().GetData(), pAct->GetLink().GetDataSize() );
+ nCrc = vcl_get_checksum( nCrc, pAct->GetLink().GetData(), pAct->GetLink().GetDataSize() );
}
break;
@@ -2631,9 +2631,9 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
const basegfx::B2DPoint aPoint(aPolygon.getB2DPoint(b));
DoubleToSVBT64(aPoint.getX(), aSVBT64);
- nCrc = rtl_crc32(nCrc, aSVBT64, 8);
+ nCrc = vcl_get_checksum(nCrc, aSVBT64, 8);
DoubleToSVBT64(aPoint.getY(), aSVBT64);
- nCrc = rtl_crc32(nCrc, aSVBT64, 8);
+ nCrc = vcl_get_checksum(nCrc, aSVBT64, 8);
if(bControl)
{
@@ -2642,9 +2642,9 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
const basegfx::B2DPoint aCtrl(aPolygon.getPrevControlPoint(b));
DoubleToSVBT64(aCtrl.getX(), aSVBT64);
- nCrc = rtl_crc32(nCrc, aSVBT64, 8);
+ nCrc = vcl_get_checksum(nCrc, aSVBT64, 8);
DoubleToSVBT64(aCtrl.getY(), aSVBT64);
- nCrc = rtl_crc32(nCrc, aSVBT64, 8);
+ nCrc = vcl_get_checksum(nCrc, aSVBT64, 8);
}
if(aPolygon.isNextControlPointUsed(b))
@@ -2652,21 +2652,21 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
const basegfx::B2DPoint aCtrl(aPolygon.getNextControlPoint(b));
DoubleToSVBT64(aCtrl.getX(), aSVBT64);
- nCrc = rtl_crc32(nCrc, aSVBT64, 8);
+ nCrc = vcl_get_checksum(nCrc, aSVBT64, 8);
DoubleToSVBT64(aCtrl.getY(), aSVBT64);
- nCrc = rtl_crc32(nCrc, aSVBT64, 8);
+ nCrc = vcl_get_checksum(nCrc, aSVBT64, 8);
}
}
}
}
sal_uInt8 tmp = (sal_uInt8)rAct.IsClipping();
- nCrc = rtl_crc32(nCrc, &tmp, 1);
+ nCrc = vcl_get_checksum(nCrc, &tmp, 1);
}
else
{
pAction->Write( aMemStm, &aWriteData );
- nCrc = rtl_crc32( nCrc, aMemStm.GetData(), aMemStm.Tell() );
+ nCrc = vcl_get_checksum( nCrc, aMemStm.GetData(), aMemStm.Tell() );
aMemStm.Seek( 0 );
}
}
@@ -2675,7 +2675,7 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
default:
{
pAction->Write( aMemStm, &aWriteData );
- nCrc = rtl_crc32( nCrc, aMemStm.GetData(), aMemStm.Tell() );
+ nCrc = vcl_get_checksum( nCrc, aMemStm.GetData(), aMemStm.Tell() );
aMemStm.Seek( 0 );
}
break;
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 36d96e9..c3185ec 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -11516,7 +11516,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
aID.m_aPixelSize = rSizePixel;
aID.m_nSize = pStream->Tell();
pStream->Seek( STREAM_SEEK_TO_BEGIN );
- aID.m_nChecksum = rtl_crc32( 0, pStream->GetData(), aID.m_nSize );
+ aID.m_nChecksum = vcl_get_checksum( 0, pStream->GetData(), aID.m_nSize );
if( ! rMask.IsEmpty() )
aID.m_nMaskChecksum = rMask.GetChecksum();
commit 7fe85d7633a6cb7a921e93d9399c748a41c54bc1
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Thu Aug 27 15:25:11 2015 +0200
Switching to 64-bit checksum: substituted sal_uLong with BitmapChecksum
A typedef sal_uLong BitmapChecksum;
has been added to include/vcl/checksum.hxx
Wherever needed sal_uLong and sal_Int32 has been substituted with
BitmapChecksum.
A BITMAP_CHECKSUM_BITS constant equal to the amount of bits used by the
BitmapChecksum type has been defined and used in
`GraphicID::GetIDString` (vstools/source/graphic/grfcache.cxx).
Change-Id: I74bd285089e58a8b18c06233d75b87023c7bf31b
diff --git a/filter/source/flash/swfexporter.cxx b/filter/source/flash/swfexporter.cxx
index 8b6be55..8021b08 100644
--- a/filter/source/flash/swfexporter.cxx
+++ b/filter/source/flash/swfexporter.cxx
@@ -431,8 +431,8 @@ sal_uInt16 FlashExporter::exportDrawPageBackground(sal_uInt16 nPage, Reference<
getMetaFile( xCompMaster, aMtfMaster, true );
getMetaFile( xComponent, aMtfPrivate, true );
- sal_uInt32 masterchecksum = aMtfMaster.GetChecksum();
- sal_uInt32 privatechecksum = aMtfPrivate.GetChecksum();
+ BitmapChecksum masterchecksum = aMtfMaster.GetChecksum();
+ BitmapChecksum privatechecksum = aMtfPrivate.GetChecksum();
// AS: If the slide has its own background
if (privatechecksum)
@@ -484,7 +484,7 @@ sal_uInt16 FlashExporter::exportMasterPageObjects(sal_uInt16 nPage, Reference< X
{
Reference< XShapes > xShapes( xMasterPage, UNO_QUERY );
- sal_uInt32 shapesum = ActionSummer(xShapes);
+ BitmapChecksum shapesum = ActionSummer(xShapes);
ChecksumCache::iterator it = gObjectCache.find(shapesum);
@@ -631,7 +631,7 @@ void FlashExporter::exportShape( const Reference< XShape >& xShape, bool bMaster
getMetaFile( xComponent, aMtf, false, true );
sal_uInt16 nID;
- sal_uInt32 checksum = aMtf.GetChecksum();
+ BitmapChecksum checksum = aMtf.GetChecksum();
ChecksumCache::iterator it = gMetafileCache.find(checksum);
@@ -748,7 +748,7 @@ bool FlashExporter::getMetaFile( Reference< XComponent >&xComponent, GDIMetaFile
return rMtf.GetActionSize() != 0;
}
-sal_uInt32 FlashExporter::ActionSummer(Reference< XShape >& xShape)
+BitmapChecksum FlashExporter::ActionSummer(Reference< XShape >& xShape)
{
Reference< XShapes > xShapes( xShape, UNO_QUERY );
@@ -767,10 +767,10 @@ sal_uInt32 FlashExporter::ActionSummer(Reference< XShape >& xShape)
}
}
-sal_uInt32 FlashExporter::ActionSummer(Reference< XShapes >& xShapes)
+BitmapChecksum FlashExporter::ActionSummer(Reference< XShapes >& xShapes)
{
sal_uInt32 nShapeCount = xShapes->getCount();
- sal_uInt32 shapecount = 0;
+ BitmapChecksum shapecount = 0;
Reference< XShape > xShape2;
diff --git a/filter/source/flash/swfexporter.hxx b/filter/source/flash/swfexporter.hxx
index b1c5024..7b08669 100644
--- a/filter/source/flash/swfexporter.hxx
+++ b/filter/source/flash/swfexporter.hxx
@@ -29,11 +29,12 @@
#include <com/sun/star/presentation/ClickAction.hpp>
#include <com/sun/star/presentation/FadeEffect.hpp>
#include <osl/file.hxx>
+#include <vcl/checksum.hxx>
#include <vector>
#include <map>
-typedef ::std::map<sal_uInt32, sal_uInt16> ChecksumCache;
+typedef ::std::map<BitmapChecksum, sal_uInt16> ChecksumCache;
class GDIMetaFile;
@@ -179,8 +180,8 @@ private:
void exportShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes, bool bStream, bool bMaster );
void exportShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, bool bMaster);
- sal_uInt32 ActionSummer(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape);
- sal_uInt32 ActionSummer(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes);
+ BitmapChecksum ActionSummer(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape);
+ BitmapChecksum ActionSummer(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes);
bool getMetaFile( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&xComponent, GDIMetaFile& rMtf, bool bOnlyBackground = false, bool bExportAsJPEG = false );
diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx
index 19e5235..a9a795f 100644
--- a/filter/source/flash/swfwriter.hxx
+++ b/filter/source/flash/swfwriter.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <vcl/checksum.hxx>
#include <vcl/font.hxx>
#include <vcl/gradient.hxx>
#include <vcl/vclptr.hxx>
@@ -106,7 +107,7 @@ sal_uInt32 getFixed( double fValue );
-typedef ::std::map<sal_uInt32, sal_uInt16> ChecksumCache;
+typedef ::std::map<BitmapChecksum, sal_uInt16> ChecksumCache;
/** unsigned int 16 compare operation for stl */
struct ltuint16
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index db9f332..ac7f94d 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -787,7 +787,7 @@ void getBitmapData( const BitmapEx& aBmpEx, sal_uInt8*& tgadata, sal_uInt8*& tga
sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQualityLevel )
{
- const sal_uInt32 bmpChecksum = bmpSource.GetChecksum();
+ BitmapChecksum bmpChecksum = bmpSource.GetChecksum();
ChecksumCache::iterator it = mBitmapCache.find(bmpChecksum);
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 87891dc..1773740 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -424,9 +424,9 @@ bool ObjectRepresentation::operator==( const ObjectRepresentation& rPresentation
namespace
{
-sal_uInt32 GetBitmapChecksum( const MetaAction* pAction )
+BitmapChecksum GetBitmapChecksum( const MetaAction* pAction )
{
- sal_uInt32 nChecksum = 0;
+ BitmapChecksum nChecksum = 0;
const MetaActionType nType = pAction->GetType();
switch( nType )
@@ -509,8 +509,8 @@ bool EqualityBitmap::operator()( const ObjectRepresentation& rObjRep1,
const GDIMetaFile& aMtf2 = rObjRep2.GetRepresentation();
if( aMtf1.GetActionSize() == 1 && aMtf2.GetActionSize() == 1 )
{
- const sal_uInt32 nChecksum1 = GetBitmapChecksum( aMtf1.GetAction( 0 ) );
- const sal_uInt32 nChecksum2 = GetBitmapChecksum( aMtf2.GetAction( 0 ) );
+ BitmapChecksum nChecksum1 = GetBitmapChecksum( aMtf1.GetAction( 0 ) );
+ BitmapChecksum nChecksum2 = GetBitmapChecksum( aMtf2.GetAction( 0 ) );
return ( nChecksum1 == nChecksum2 );
}
else
@@ -1302,7 +1302,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps()
MetaAction* pAction = aMtf.GetAction( 0 );
if( pAction )
{
- const sal_uInt32 nId = GetBitmapChecksum( pAction );
+ BitmapChecksum nId = GetBitmapChecksum( pAction );
sId = "bitmap(" + OUString::number( nId ) + ")";
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 73c01f2..62b9f29 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1359,7 +1359,7 @@ void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction
}
// bitmap placeholder element
- const sal_uInt32 nId = SVGActionWriter::GetChecksum( pAction );
+ BitmapChecksum nId = SVGActionWriter::GetChecksum( pAction );
OUString sId = "bitmap-placeholder(" + msShapeId + "." +
OUString::number( nId ) + ")";
@@ -1381,7 +1381,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
const GDIMetaFile& rMtf = *mpTextEmbeddedBitmapMtf;
OUString sId, sRefId;
- sal_uInt32 nChecksum = 0;
+ BitmapChecksum nId, nChecksum = 0;
Point aPt;
Size aSz;
sal_uLong nCount = rMtf.GetActionSize();
@@ -1779,7 +1779,7 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
return aPathData;
}
-sal_uInt32 SVGActionWriter::GetChecksum( const MetaAction* pAction )
+BitmapChecksum SVGActionWriter::GetChecksum( const MetaAction* pAction )
{
GDIMetaFile aMtf;
MetaAction* pA = const_cast<MetaAction*>(pAction);
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index e96e516..280bd52 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -357,7 +357,7 @@ private:
public:
static OUString GetPathString( const tools::PolyPolygon& rPolyPoly, bool bLine );
- static sal_uInt32 GetChecksum( const MetaAction* pAction );
+ static BitmapChecksum GetChecksum( const MetaAction* pAction );
public:
diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
index 8aba78d..e943906 100644
--- a/include/vcl/alpha.hxx
+++ b/include/vcl/alpha.hxx
@@ -49,7 +49,7 @@ public:
Size GetSizePixel() const { return Bitmap::GetSizePixel(); }
- sal_uInt32 GetChecksum() const { return Bitmap::GetChecksum(); }
+ BitmapChecksum GetChecksum() const { return Bitmap::GetChecksum(); }
Bitmap GetBitmap() const;
diff --git a/include/vcl/animate.hxx b/include/vcl/animate.hxx
index 7650d6f..801d9e4 100644
--- a/include/vcl/animate.hxx
+++ b/include/vcl/animate.hxx
@@ -88,7 +88,7 @@ struct VCL_DLLPUBLIC AnimationBitmap
{ return !( *this == rAnimBmp ); }
- sal_uInt32 GetChecksum() const;
+ BitmapChecksum GetChecksum() const;
};
struct AInfo
@@ -162,7 +162,7 @@ public:
void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation );
sal_uLong GetSizeBytes() const;
- sal_uInt32 GetChecksum() const;
+ BitmapChecksum GetChecksum() const;
public:
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index af92b3e..ddb6b32 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -23,6 +23,7 @@
#include <tools/color.hxx>
#include <tools/link.hxx>
#include <tools/solar.h>
+#include <vcl/checksum.hxx>
#include <vcl/dllapi.h>
#include <vcl/mapmod.hxx>
#include <vcl/region.hxx>
@@ -289,7 +290,7 @@ public:
*/
bool GetSystemData( BitmapSystemData& rData ) const;
- sal_uInt32 GetChecksum() const;
+ BitmapChecksum GetChecksum() const;
Bitmap CreateDisplayBitmap( OutputDevice* pDisplay );
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index a4b7857..8d9b8ec 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -91,7 +91,7 @@ public:
sal_uInt16 GetBitCount() const { return aBitmap.GetBitCount(); }
sal_uLong GetSizeBytes() const;
- sal_uInt32 GetChecksum() const;
+ BitmapChecksum GetChecksum() const;
public:
diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index ae7c9d6..53c2f16 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -22,9 +22,9 @@
#define INCLUDED_VCL_INC_CHECKSUM_HXX
#include <sal/config.h>
-
#include <sal/saldllapi.h>
#include <sal/types.h>
+#include <tools/solar.h>
/*========================================================================
*
@@ -120,6 +120,10 @@ static const sal_uInt64 vcl_crc64Table[256] = {
0x29b7d047efec8728ULL
};
+typedef sal_uLong BitmapChecksum;
+
+#define BITMAP_CHECKSUM_BITS (sizeof(BitmapChecksum) * 8)
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 1ffb9dc..4750933 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -190,7 +190,7 @@ public:
void SetPrefMapMode( const MapMode& rMapMode ) { aPrefMapMode = rMapMode; }
- sal_uInt32 GetChecksum() const;
+ BitmapChecksum GetChecksum() const;
sal_uLong GetSizeBytes() const;
// Methods for reading and writing the new formats;
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index a99408d..cc2890d 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -158,9 +158,9 @@ public:
void SetAnimationNotifyHdl( const Link<>& rLink );
Link<> GetAnimationNotifyHdl() const;
- sal_uLong GetAnimationLoopCount() const;
+ sal_uLong GetAnimationLoopCount() const;
- sal_uInt32 GetChecksum() const;
+ BitmapChecksum GetChecksum() const;
public:
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index c7b573e..25ae4f4 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -43,7 +43,7 @@ private:
sal_uInt32 mnID1;
sal_uInt32 mnID2;
sal_uInt32 mnID3;
- sal_uInt32 mnID4;
+ BitmapChecksum mnID4;
public:
@@ -134,7 +134,7 @@ OString GraphicID::GetIDString() const
for( nShift = 28; nShift >= 0; nShift -= 4 )
aHexStr[nIndex++] = aHexData[ ( mnID3 >> (sal_uInt32) nShift ) & 0xf ];
- for( nShift = 28; nShift >= 0; nShift -= 4 )
+ for( nShift = BITMAP_CHECKSUM_BITS - 4; nShift >= 0; nShift -= 4 )
aHexStr[nIndex++] = aHexData[ ( mnID4 >> (sal_uInt32) nShift ) & 0xf ];
return aHexStr.makeStringAndClear();
diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index 9dd483a..f2bd27d 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -69,7 +69,7 @@ public:
void ImplIncRefCount() { mnRefCount++; }
void ImplDecRefCount() { mnRefCount--; }
- sal_uLong ImplGetChecksum() const;
+ BitmapChecksum ImplGetChecksum() const;
void ImplInvalidateChecksum();
bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index b68e6d3..51937b5 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -145,7 +145,7 @@ private:
GfxLink ImplGetLink();
bool ImplIsLink() const;
- sal_uInt32 ImplGetChecksum() const;
+ BitmapChecksum ImplGetChecksum() const;
bool ImplExportNative( SvStream& rOStm ) const;
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index c1f8f4b..cb5c934 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -31,9 +31,9 @@
sal_uLong Animation::mnAnimCount = 0UL;
-sal_uInt32 AnimationBitmap::GetChecksum() const
+BitmapChecksum AnimationBitmap::GetChecksum() const
{
- sal_uInt32 nCrc = aBmpEx.GetChecksum();
+ BitmapChecksum nCrc = aBmpEx.GetChecksum();
SVBT32 aBT32;
UInt32ToSVBT32( aPosPix.X(), aBT32 );
@@ -206,10 +206,10 @@ sal_uLong Animation::GetSizeBytes() const
return nSizeBytes;
}
-sal_uInt32 Animation::GetChecksum() const
+BitmapChecksum Animation::GetChecksum() const
{
SVBT32 aBT32;
- sal_uInt32 nCrc = GetBitmapEx().GetChecksum();
+ BitmapChecksum nCrc = GetBitmapEx().GetChecksum();
UInt32ToSVBT32( maList.size(), aBT32 );
nCrc = rtl_crc32( nCrc, aBT32, 4 );
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 6f96c05..23b752b 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -284,9 +284,9 @@ bool Bitmap::HasGreyPalette() const
return bRet;
}
-sal_uInt32 Bitmap::GetChecksum() const
+BitmapChecksum Bitmap::GetChecksum() const
{
- sal_uInt32 nRet = 0;
+ BitmapChecksum nRet = 0;
if( mpImpBmp )
{
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 1a28a25..9559e9f 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -308,9 +308,9 @@ sal_uLong BitmapEx::GetSizeBytes() const
return nSizeBytes;
}
-sal_uInt32 BitmapEx::GetChecksum() const
+BitmapChecksum BitmapEx::GetChecksum() const
{
- sal_uInt32 nCrc = aBitmap.GetChecksum();
+ BitmapChecksum nCrc = aBitmap.GetChecksum();
SVBT32 aBT32;
UInt32ToSVBT32( (long) eTransparent, aBT32 );
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 9979e3c..a4946bb 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2340,14 +2340,14 @@ GDIMetaFile GDIMetaFile::GetMonochromeMtf( const Color& rColor ) const
return aRet;
}
-sal_uInt32 GDIMetaFile::GetChecksum() const
+BitmapChecksum GDIMetaFile::GetChecksum() const
{
GDIMetaFile aMtf;
SvMemoryStream aMemStm( 65535, 65535 );
ImplMetaWriteData aWriteData;
SVBT16 aBT16;
SVBT32 aBT32;
- sal_uInt32 nCrc = 0;
+ BitmapChecksum nCrc = 0;
aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
for( size_t i = 0, nObjCount = GetActionSize(); i < nObjCount; i++ )
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 93acaa1..9eafd50 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -535,7 +535,7 @@ bool Graphic::IsLink() const
return mpImpGraphic->ImplIsLink();
}
-sal_uInt32 Graphic::GetChecksum() const
+BitmapChecksum Graphic::GetChecksum() const
{
return mpImpGraphic->ImplGetChecksum();
}
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index f700122..baf2191 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -92,11 +92,11 @@ void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode
ImplInvalidateChecksum();
}
-sal_uLong ImpBitmap::ImplGetChecksum() const
+BitmapChecksum ImpBitmap::ImplGetChecksum() const
{
SalBitmap::ChecksumType aChecksum;
mpSalBitmap->GetChecksum(aChecksum);
- sal_uLong a32BitChecksum = aChecksum;
+ BitmapChecksum a32BitChecksum = aChecksum;
return a32BitChecksum;
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 9dc9a32..72abc23 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1360,9 +1360,9 @@ bool ImpGraphic::ImplIsLink() const
return ( mpGfxLink != NULL );
}
-sal_uInt32 ImpGraphic::ImplGetChecksum() const
+BitmapChecksum ImpGraphic::ImplGetChecksum() const
{
- sal_uInt32 nRet = 0;
+ BitmapChecksum nRet = 0;
if( ImplIsSupportedGraphic() && !ImplIsSwapOut() )
{
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 43081aa..c9affe6 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -177,8 +177,8 @@ public:
{
Size m_aPixelSize;
sal_Int32 m_nSize;
- sal_Int32 m_nChecksum;
- sal_Int32 m_nMaskChecksum;
+ BitmapChecksum m_nChecksum;
+ BitmapChecksum m_nMaskChecksum;
BitmapID() : m_nSize( 0 ), m_nChecksum( 0 ), m_nMaskChecksum( 0 ) {}
commit b5e3aa40586a4cca050b4f74a6f5d9bf90ff8b3a
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Thu Aug 27 12:12:52 2015 +0200
moved chechsum.hxx in include/vcl
Change-Id: I70f82f16d5907ce0bbe2d838c4acee226886aab2
diff --git a/vcl/inc/checksum.hxx b/include/vcl/checksum.hxx
similarity index 100%
rename from vcl/inc/checksum.hxx
rename to include/vcl/checksum.hxx
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index 268e06c..a9160e1 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -23,10 +23,9 @@
#include <tools/gen.hxx>
#include <tools/solar.h>
#include <vcl/dllapi.h>
+#include <vcl/checksum.hxx>
#include <vcl/salbtype.hxx>
-#include <checksum.hxx>
-
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
struct BitmapBuffer;
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 8ab721e..f4f17ff 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -22,6 +22,7 @@
#include <vcl/opengl/OpenGLHelper.hxx>
#include "vcl/bitmap.hxx"
+#include "vcl/checksum.hxx"
#include "vcl/outdev.hxx"
#include "vcl/salbtype.hxx"
#include "svdata.hxx"
@@ -31,7 +32,6 @@
#include "opengl/program.hxx"
#include "opengl/salbmp.hxx"
-#include "../inc/checksum.hxx"
#include "opengl/FixedTextureAtlas.hxx"
namespace
diff --git a/vcl/source/bitmap/checksum.cxx b/vcl/source/bitmap/checksum.cxx
index a46db1e..46042b0 100644
--- a/vcl/source/bitmap/checksum.cxx
+++ b/vcl/source/bitmap/checksum.cxx
@@ -18,7 +18,7 @@
*/
#include <sal/types.h>
-#include <checksum.hxx>
+#include <vcl/checksum.hxx>
/*========================================================================
*
commit ebb0dc14547e698d7b53005178063da72d48f075
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Wed Aug 26 13:50:57 2015 +0200
Added support for computing 64-bit checksum of bitmap in OpenGL
Added a C++ and a GLSL implementation of a 64-bit CRC algorithm.
Changed hardcoded checksum value in ooxmlimport unit test (testN777345).
Change-Id: I16bb985a14866775efda49e21fe033ff64645896
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 576beae..625ec12 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -750,7 +750,7 @@ DECLARE_OOXMLIMPORT_TEST(testN777345, "n777345.docx")
Graphic aGraphic(xGraphic);
// If this changes later, feel free to update it, but make sure it's not
// the checksum of a white/transparent placeholder rectangle.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(2529763117UL), aGraphic.GetChecksum());
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(1256330431U), aGraphic.GetChecksum());
#endif
}
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 306178c..faa8f43 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -318,6 +318,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/bitmap/bitmapscalesuper \
vcl/source/bitmap/BitmapSymmetryCheck \
vcl/source/bitmap/BitmapFilterStackBlur \
+ vcl/source/bitmap/checksum \
vcl/source/helper/canvasbitmap \
vcl/source/helper/canvastools \
vcl/source/helper/evntpost \
diff --git a/vcl/Package_opengl.mk b/vcl/Package_opengl.mk
index 2628dcd..df3520c 100644
--- a/vcl/Package_opengl.mk
+++ b/vcl/Package_opengl.mk
@@ -10,6 +10,7 @@
$(eval $(call gb_Package_Package,vcl_opengl_shader,$(SRCDIR)/vcl/opengl))
$(eval $(call gb_Package_add_files,vcl_opengl_shader,$(LIBO_ETC_FOLDER)/opengl,\
+ areaHashCRC64TFragmentShader.glsl \
areaScaleFastFragmentShader.glsl \
areaScaleFragmentShader.glsl \
blendedTextureFragmentShader.glsl \
diff --git a/vcl/inc/checksum.hxx b/vcl/inc/checksum.hxx
new file mode 100644
index 0000000..ae7c9d6
--- /dev/null
+++ b/vcl/inc/checksum.hxx
@@ -0,0 +1,154 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * 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
+
+#include <sal/config.h>
+
+#include <sal/saldllapi.h>
+#include <sal/types.h>
+
+/*========================================================================
+ *
+ * vcl_crc64Table (CRC polynomial 0x95AC9329AC4BC9B5ULL).
+ *
+ *======================================================================*/
+static const sal_uInt64 vcl_crc64Table[256] = {
+ 0x0000000000000000ULL, 0x7ad870c830358979ULL, 0xf5b0e190606b12f2ULL,
+ 0x8f689158505e9b8bULL, 0xc038e5739841b68fULL, 0xbae095bba8743ff6ULL,
+ 0x358804e3f82aa47dULL, 0x4f50742bc81f2d04ULL, 0xab28ecb46814fe75ULL,
+ 0xd1f09c7c5821770cULL, 0x5e980d24087fec87ULL, 0x24407dec384a65feULL,
+ 0x6b1009c7f05548faULL, 0x11c8790fc060c183ULL, 0x9ea0e857903e5a08ULL,
+ 0xe478989fa00bd371ULL, 0x7d08ff3b88be6f81ULL, 0x07d08ff3b88be6f8ULL,
+ 0x88b81eabe8d57d73ULL, 0xf2606e63d8e0f40aULL, 0xbd301a4810ffd90eULL,
+ 0xc7e86a8020ca5077ULL, 0x4880fbd87094cbfcULL, 0x32588b1040a14285ULL,
+ 0xd620138fe0aa91f4ULL, 0xacf86347d09f188dULL, 0x2390f21f80c18306ULL,
+ 0x594882d7b0f40a7fULL, 0x1618f6fc78eb277bULL, 0x6cc0863448deae02ULL,
+ 0xe3a8176c18803589ULL, 0x997067a428b5bcf0ULL, 0xfa11fe77117cdf02ULL,
+ 0x80c98ebf2149567bULL, 0x0fa11fe77117cdf0ULL, 0x75796f2f41224489ULL,
+ 0x3a291b04893d698dULL, 0x40f16bccb908e0f4ULL, 0xcf99fa94e9567b7fULL,
+ 0xb5418a5cd963f206ULL, 0x513912c379682177ULL, 0x2be1620b495da80eULL,
+ 0xa489f35319033385ULL, 0xde51839b2936bafcULL, 0x9101f7b0e12997f8ULL,
+ 0xebd98778d11c1e81ULL, 0x64b116208142850aULL, 0x1e6966e8b1770c73ULL,
+ 0x8719014c99c2b083ULL, 0xfdc17184a9f739faULL, 0x72a9e0dcf9a9a271ULL,
+ 0x08719014c99c2b08ULL, 0x4721e43f0183060cULL, 0x3df994f731b68f75ULL,
+ 0xb29105af61e814feULL, 0xc849756751dd9d87ULL, 0x2c31edf8f1d64ef6ULL,
+ 0x56e99d30c1e3c78fULL, 0xd9810c6891bd5c04ULL, 0xa3597ca0a188d57dULL,
+ 0xec09088b6997f879ULL, 0x96d1784359a27100ULL, 0x19b9e91b09fcea8bULL,
+ 0x636199d339c963f2ULL, 0xdf7adabd7a6e2d6fULL, 0xa5a2aa754a5ba416ULL,
+ 0x2aca3b2d1a053f9dULL, 0x50124be52a30b6e4ULL, 0x1f423fcee22f9be0ULL,
+ 0x659a4f06d21a1299ULL, 0xeaf2de5e82448912ULL, 0x902aae96b271006bULL,
+ 0x74523609127ad31aULL, 0x0e8a46c1224f5a63ULL, 0x81e2d7997211c1e8ULL,
+ 0xfb3aa75142244891ULL, 0xb46ad37a8a3b6595ULL, 0xceb2a3b2ba0eececULL,
+ 0x41da32eaea507767ULL, 0x3b024222da65fe1eULL, 0xa2722586f2d042eeULL,
+ 0xd8aa554ec2e5cb97ULL, 0x57c2c41692bb501cULL, 0x2d1ab4dea28ed965ULL,
+ 0x624ac0f56a91f461ULL, 0x1892b03d5aa47d18ULL, 0x97fa21650afae693ULL,
+ 0xed2251ad3acf6feaULL, 0x095ac9329ac4bc9bULL, 0x7382b9faaaf135e2ULL,
+ 0xfcea28a2faafae69ULL, 0x8632586aca9a2710ULL, 0xc9622c4102850a14ULL,
+ 0xb3ba5c8932b0836dULL, 0x3cd2cdd162ee18e6ULL, 0x460abd1952db919fULL,
+ 0x256b24ca6b12f26dULL, 0x5fb354025b277b14ULL, 0xd0dbc55a0b79e09fULL,
+ 0xaa03b5923b4c69e6ULL, 0xe553c1b9f35344e2ULL, 0x9f8bb171c366cd9bULL,
+ 0x10e3202993385610ULL, 0x6a3b50e1a30ddf69ULL, 0x8e43c87e03060c18ULL,
+ 0xf49bb8b633338561ULL, 0x7bf329ee636d1eeaULL, 0x012b592653589793ULL,
+ 0x4e7b2d0d9b47ba97ULL, 0x34a35dc5ab7233eeULL, 0xbbcbcc9dfb2ca865ULL,
+ 0xc113bc55cb19211cULL, 0x5863dbf1e3ac9decULL, 0x22bbab39d3991495ULL,
+ 0xadd33a6183c78f1eULL, 0xd70b4aa9b3f20667ULL, 0x985b3e827bed2b63ULL,
+ 0xe2834e4a4bd8a21aULL, 0x6debdf121b863991ULL, 0x1733afda2bb3b0e8ULL,
+ 0xf34b37458bb86399ULL, 0x8993478dbb8deae0ULL, 0x06fbd6d5ebd3716bULL,
+ 0x7c23a61ddbe6f812ULL, 0x3373d23613f9d516ULL, 0x49aba2fe23cc5c6fULL,
+ 0xc6c333a67392c7e4ULL, 0xbc1b436e43a74e9dULL, 0x95ac9329ac4bc9b5ULL,
+ 0xef74e3e19c7e40ccULL, 0x601c72b9cc20db47ULL, 0x1ac40271fc15523eULL,
+ 0x5594765a340a7f3aULL, 0x2f4c0692043ff643ULL, 0xa02497ca54616dc8ULL,
+ 0xdafce7026454e4b1ULL, 0x3e847f9dc45f37c0ULL, 0x445c0f55f46abeb9ULL,
+ 0xcb349e0da4342532ULL, 0xb1eceec59401ac4bULL, 0xfebc9aee5c1e814fULL,
+ 0x8464ea266c2b0836ULL, 0x0b0c7b7e3c7593bdULL, 0x71d40bb60c401ac4ULL,
+ 0xe8a46c1224f5a634ULL, 0x927c1cda14c02f4dULL, 0x1d148d82449eb4c6ULL,
+ 0x67ccfd4a74ab3dbfULL, 0x289c8961bcb410bbULL, 0x5244f9a98c8199c2ULL,
+ 0xdd2c68f1dcdf0249ULL, 0xa7f41839ecea8b30ULL, 0x438c80a64ce15841ULL,
+ 0x3954f06e7cd4d138ULL, 0xb63c61362c8a4ab3ULL, 0xcce411fe1cbfc3caULL,
+ 0x83b465d5d4a0eeceULL, 0xf96c151de49567b7ULL, 0x76048445b4cbfc3cULL,
+ 0x0cdcf48d84fe7545ULL, 0x6fbd6d5ebd3716b7ULL, 0x15651d968d029fceULL,
+ 0x9a0d8ccedd5c0445ULL, 0xe0d5fc06ed698d3cULL, 0xaf85882d2576a038ULL,
+ 0xd55df8e515432941ULL, 0x5a3569bd451db2caULL, 0x20ed197575283bb3ULL,
+ 0xc49581ead523e8c2ULL, 0xbe4df122e51661bbULL, 0x3125607ab548fa30ULL,
+ 0x4bfd10b2857d7349ULL, 0x04ad64994d625e4dULL, 0x7e7514517d57d734ULL,
+ 0xf11d85092d094cbfULL, 0x8bc5f5c11d3cc5c6ULL, 0x12b5926535897936ULL,
+ 0x686de2ad05bcf04fULL, 0xe70573f555e26bc4ULL, 0x9ddd033d65d7e2bdULL,
+ 0xd28d7716adc8cfb9ULL, 0xa85507de9dfd46c0ULL, 0x273d9686cda3dd4bULL,
+ 0x5de5e64efd965432ULL, 0xb99d7ed15d9d8743ULL, 0xc3450e196da80e3aULL,
+ 0x4c2d9f413df695b1ULL, 0x36f5ef890dc31cc8ULL, 0x79a59ba2c5dc31ccULL,
+ 0x037deb6af5e9b8b5ULL, 0x8c157a32a5b7233eULL, 0xf6cd0afa9582aa47ULL,
+ 0x4ad64994d625e4daULL, 0x300e395ce6106da3ULL, 0xbf66a804b64ef628ULL,
+ 0xc5bed8cc867b7f51ULL, 0x8aeeace74e645255ULL, 0xf036dc2f7e51db2cULL,
+ 0x7f5e4d772e0f40a7ULL, 0x05863dbf1e3ac9deULL, 0xe1fea520be311aafULL,
+ 0x9b26d5e88e0493d6ULL, 0x144e44b0de5a085dULL, 0x6e963478ee6f8124ULL,
+ 0x21c640532670ac20ULL, 0x5b1e309b16452559ULL, 0xd476a1c3461bbed2ULL,
+ 0xaeaed10b762e37abULL, 0x37deb6af5e9b8b5bULL, 0x4d06c6676eae0222ULL,
+ 0xc26e573f3ef099a9ULL, 0xb8b627f70ec510d0ULL, 0xf7e653dcc6da3dd4ULL,
+ 0x8d3e2314f6efb4adULL, 0x0256b24ca6b12f26ULL, 0x788ec2849684a65fULL,
+ 0x9cf65a1b368f752eULL, 0xe62e2ad306bafc57ULL, 0x6946bb8b56e467dcULL,
+ 0x139ecb4366d1eea5ULL, 0x5ccebf68aecec3a1ULL, 0x2616cfa09efb4ad8ULL,
+ 0xa97e5ef8cea5d153ULL, 0xd3a62e30fe90582aULL, 0xb0c7b7e3c7593bd8ULL,
+ 0xca1fc72bf76cb2a1ULL, 0x45775673a732292aULL, 0x3faf26bb9707a053ULL,
+ 0x70ff52905f188d57ULL, 0x0a2722586f2d042eULL, 0x854fb3003f739fa5ULL,
+ 0xff97c3c80f4616dcULL, 0x1bef5b57af4dc5adULL, 0x61372b9f9f784cd4ULL,
+ 0xee5fbac7cf26d75fULL, 0x9487ca0fff135e26ULL, 0xdbd7be24370c7322ULL,
+ 0xa10fceec0739fa5bULL, 0x2e675fb4576761d0ULL, 0x54bf2f7c6752e8a9ULL,
+ 0xcdcf48d84fe75459ULL, 0xb71738107fd2dd20ULL, 0x387fa9482f8c46abULL,
+ 0x42a7d9801fb9cfd2ULL, 0x0df7adabd7a6e2d6ULL, 0x772fdd63e7936bafULL,
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list