diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-03-21 15:04:25 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-03-21 15:14:45 +0100 |
commit | ebe247642d85d39b6e1ffae3cf92c31748f2e983 (patch) | |
tree | 2d7ef84826a9be1ae3a2cb1d37d497c471b2cdc8 /vcl/quartz | |
parent | 17407f808ed0ca5d65a98da186f7e2ab60dc641b (diff) |
Revert "tdf#116213 OS X and OpenGL bitmap scaline sizes are not 32-bit aligned"
This reverts commit 460f39e687393b3a8906d2adc3e8f7a0c749851a.
For one, it had started to make bitmap checksum equality check in
svx/qa/unit/XTableImportExportTest.cxx, CppunitTest_svx_unit, fail most of the
time in macOS --disable-dbgutil builds, as the bitmap checksum is now computed
also over padding bytes containing random values (but --enable-dbgutil
initializes those bytes). And why would fixing tdf#116213 for Windows require
touching the macOS-specific code, anyway?
For another, tdf#116213 comments 6 and 7 report further problems that are likely
linked to this commit.
Change-Id: I3e158813ab89a1ead3780abbf6b120ec52660231
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/salbmp.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index 04fb820b08a3..f9a10a44020b 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -310,10 +310,19 @@ bool QuartzSalBitmap::AllocateUserData() if( mnWidth && mnHeight ) { - assert((mnBits == 1 || mnBits == 4 || mnBits == 8 || mnBits == 16 || mnBits == 24 || mnBits == 32) - && "vcl::QuartzSalBitmap::AllocateUserData(), illegal bitcount!"); + mnBytesPerRow = 0; - mnBytesPerRow = AlignedWidth4Bytes(mnBits * mnWidth); + switch( mnBits ) + { + case 1: mnBytesPerRow = (mnWidth + 7) >> 3; break; + case 4: mnBytesPerRow = (mnWidth + 1) >> 1; break; + case 8: mnBytesPerRow = mnWidth; break; + case 16: mnBytesPerRow = mnWidth << 1; break; + case 24: mnBytesPerRow = (mnWidth << 1) + mnWidth; break; + case 32: mnBytesPerRow = mnWidth << 2; break; + default: + OSL_FAIL("vcl::QuartzSalBitmap::AllocateUserData(), illegal bitcount!"); + } } bool alloc = false; |