summaryrefslogtreecommitdiff
path: root/vcl/quartz/salbmp.cxx
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2018-03-14 01:07:07 +1100
committerTomaž Vajngerl <quikee@gmail.com>2018-03-16 09:51:36 +0100
commit460f39e687393b3a8906d2adc3e8f7a0c749851a (patch)
treefca98d7209b06616357934eb62c11057b8743a8e /vcl/quartz/salbmp.cxx
parent09d842887d7fe6bc7854290f8d87c50fa48e6d4e (diff)
tdf#116213 OS X and OpenGL bitmap scaline sizes are not 32-bit aligned
Change-Id: I92b43ae2f034bf63cc3f212ec8728c5c6b5e8934 Reviewed-on: https://gerrit.libreoffice.org/51222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/quartz/salbmp.cxx')
-rw-r--r--vcl/quartz/salbmp.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index f9a10a44020b..04fb820b08a3 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -310,19 +310,10 @@ bool QuartzSalBitmap::AllocateUserData()
if( mnWidth && mnHeight )
{
- mnBytesPerRow = 0;
+ assert((mnBits == 1 || mnBits == 4 || mnBits == 8 || mnBits == 16 || mnBits == 24 || mnBits == 32)
+ && "vcl::QuartzSalBitmap::AllocateUserData(), illegal bitcount!");
- 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!");
- }
+ mnBytesPerRow = AlignedWidth4Bytes(mnBits * mnWidth);
}
bool alloc = false;