summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-03-21 15:04:25 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-03-21 15:14:45 +0100
commitebe247642d85d39b6e1ffae3cf92c31748f2e983 (patch)
tree2d7ef84826a9be1ae3a2cb1d37d497c471b2cdc8 /vcl/qa
parent17407f808ed0ca5d65a98da186f7e2ab60dc641b (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/qa')
-rw-r--r--vcl/qa/cppunit/BitmapTest.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 0bbe6d294882..f835c7b78bc3 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -342,8 +342,15 @@ void BitmapTest::testConvert()
{
Bitmap::ScopedReadAccess pReadAccess(aBitmap);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(8), pReadAccess->GetBitCount());
- // scanline should pad to 32-bit multiples
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(12), pReadAccess->GetScanlineSize());
+#if defined MACOSX || defined IOS
+ //it would be nice to find and change the stride for quartz to be the same as everyone else
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(10), pReadAccess->GetScanlineSize());
+#else
+#if HAVE_FEATURE_OPENGL
+ if (!OpenGLHelper::isVCLOpenGLEnabled())
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(12), pReadAccess->GetScanlineSize());
+#endif
+#endif
CPPUNIT_ASSERT(pReadAccess->HasPalette());
const BitmapColor& rColor = pReadAccess->GetPaletteColor(pReadAccess->GetPixelIndex(1, 1));
CPPUNIT_ASSERT_EQUAL(sal_Int32(204), sal_Int32(rColor.GetRed()));
@@ -358,8 +365,22 @@ void BitmapTest::testConvert()
Bitmap::ScopedReadAccess pReadAccess(aBitmap);
// 24 bit Bitmap on SVP backend can now use 24bit RGB everywhere.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(24), pReadAccess->GetBitCount());
- // scanline should pad to 32-bit multiples
+
+#if defined LINUX || defined FREEBSD
CPPUNIT_ASSERT_EQUAL(sal_uLong(32), pReadAccess->GetScanlineSize());
+#else
+#if defined(_WIN32)
+ if (!OpenGLHelper::isVCLOpenGLEnabled())
+ {
+ // GDI Scanlines padded to DWORD multiples, it seems
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(32), pReadAccess->GetScanlineSize());
+ }
+ else
+#endif
+ {
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(30), pReadAccess->GetScanlineSize());
+ }
+#endif
CPPUNIT_ASSERT(!pReadAccess->HasPalette());
Color aColor = pReadAccess->GetPixel(0, 0).GetColor();