diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-12-03 23:35:26 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-12-18 11:00:26 +0100 |
commit | 11adb51f2553dc4a838c8668d94909771d70e1ab (patch) | |
tree | a2cda99f892330278174ba9ffe1994438cbff314 /vcl/qa | |
parent | 0e7ccbdd559df3a446e73c367b12824c6c143579 (diff) |
vcl-svp: Store 24-bit images in 3-byte pixels
This adds support in headless rendering for more
compact 24-bit RGB image storage in 3-byte pixels
instead of 4 bytes.
There is a conversion necessary to accomodate Cairo,
which requires 4-byte pixels, but that is relatively.
Early tests show no loss of performance at runtime.
Change-Id: I3919f7c56d14d09e67f163f035b4c7683b49087c
(cherry picked from commit 354ad875092fd0c3b12f232950375206ec5d66a6)
Reviewed-on: https://gerrit.libreoffice.org/46679
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/BitmapTest.cxx | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index fe76f51e5232..3cdea8fdd928 100644 --- a/vcl/qa/cppunit/BitmapTest.cxx +++ b/vcl/qa/cppunit/BitmapTest.cxx @@ -75,24 +75,12 @@ void BitmapTest::testConvert() CPPUNIT_ASSERT_EQUAL(sal_uInt16(24), aBitmap.GetBitCount()); { Bitmap::ScopedReadAccess pReadAccess(aBitmap); -#if defined LINUX || defined FREEBSD - // 24 bit Bitmap on SVP backend uses 32bit BGRA format - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(32), pReadAccess->GetBitCount()); - CPPUNIT_ASSERT_EQUAL(sal_uLong(40), pReadAccess->GetScanlineSize()); -#else + // 24 bit Bitmap on SVP backend can now use 24bit RGB instad of 32bit BGRA format. CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(24), pReadAccess->GetBitCount()); -#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 + + // Scanlines padded to DWORD multiples, it seems + CPPUNIT_ASSERT_EQUAL(sal_uLong(32), pReadAccess->GetScanlineSize()); + CPPUNIT_ASSERT(!pReadAccess->HasPalette()); Color aColor = pReadAccess->GetPixel(0, 0); CPPUNIT_ASSERT_EQUAL(sal_Int32(204), sal_Int32(aColor.GetRed())); |