summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-03 23:35:26 -0500
committerAshod Nakashian <ashnakash@gmail.com>2017-12-26 21:48:22 +0100
commit33761c69e9d3fa16e7a5b176200d183dc3236627 (patch)
tree17712283c453b34a593ffb9040c338bb98348e23 /vcl/qa
parent6723728ae206cfbe68c18475bbdc18072d24e620 (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. Unit tests updated since the bitmap memory bytes are crc-ed, which obviously are different in size if not in content. (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> (cherry picked from commit 11adb51f2553dc4a838c8668d94909771d70e1ab) Change-Id: I3919f7c56d14d09e67f163f035b4c7683b49087c Reviewed-on: https://gerrit.libreoffice.org/47009 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/BitmapTest.cxx9
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx12
2 files changed, 11 insertions, 10 deletions
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index b26eb4572a2d..d68de41370b3 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -75,12 +75,12 @@ void BitmapTest::testConvert()
CPPUNIT_ASSERT_EQUAL(sal_uInt16(24), aBitmap.GetBitCount());
{
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());
+
#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());
+ CPPUNIT_ASSERT_EQUAL(sal_uLong(32), pReadAccess->GetScanlineSize());
#else
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(24), pReadAccess->GetBitCount());
#if defined(_WIN32)
if (!OpenGLHelper::isVCLOpenGLEnabled())
{
@@ -93,6 +93,7 @@ void BitmapTest::testConvert()
CPPUNIT_ASSERT_EQUAL(sal_uLong(30), pReadAccess->GetScanlineSize());
}
#endif
+
CPPUNIT_ASSERT(!pReadAccess->HasPalette());
Color aColor = pReadAccess->GetPixel(0, 0);
CPPUNIT_ASSERT_EQUAL(sal_Int32(204), sal_Int32(aColor.GetRed()));
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index a1b89d87a5a8..e18fa0a325a5 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -759,14 +759,14 @@ void SvmTest::checkBitmaps(const GDIMetaFile& rMetaFile)
xmlDocPtr pDoc = dumpMeta(rMetaFile);
#ifdef LINUX
- assertXPathAttrs(pDoc, "/metafile/bmp[1]", {{"x", "1"}, {"y", "2"}, {"crc", "7932585a"}});
+ assertXPathAttrs(pDoc, "/metafile/bmp[1]", {{"x", "1"}, {"y", "2"}, {"crc", "b8dee5da"}});
assertXPathAttrs(pDoc, "/metafile/bmpscale[1]", {
- {"x", "1"}, {"y", "2"}, {"width", "3"}, {"height", "4"}, {"crc", "08bfca1f"}
+ {"x", "1"}, {"y", "2"}, {"width", "3"}, {"height", "4"}, {"crc", "281fc589"}
});
assertXPathAttrs(pDoc, "/metafile/bmpscalepart[1]", {
{"destx", "1"}, {"desty", "2"}, {"destwidth", "3"}, {"destheight", "4"},
{"srcx", "2"}, {"srcy", "1"}, {"srcwidth", "4"}, {"srcheight", "3"},
- {"crc", "abd45514"}
+ {"crc", "5e01ddcc"}
});
#else
assertXPathAttrs(pDoc, "/metafile/bmp[1]", {{"x", "1"}, {"y", "2"}, {"crc", "b8dee5da"}});
@@ -815,16 +815,16 @@ void SvmTest::checkBitmapExs(const GDIMetaFile& rMetaFile)
#ifdef LINUX
assertXPathAttrs(pDoc, "/metafile/bmpex[1]", {
- {"x", "1"}, {"y", "2"}, {"crc", "7932585a"}, {"transparenttype", "bitmap"}
+ {"x", "1"}, {"y", "2"}, {"crc", "b8dee5da"}, {"transparenttype", "bitmap"}
});
assertXPathAttrs(pDoc, "/metafile/bmpexscale[1]", {
{"x", "1"}, {"y", "2"}, {"width", "3"}, {"height", "4"},
- {"crc", "08bfca1f"}, {"transparenttype", "bitmap"}
+ {"crc", "281fc589"}, {"transparenttype", "bitmap"}
});
assertXPathAttrs(pDoc, "/metafile/bmpexscalepart[1]", {
{"destx", "1"}, {"desty", "2"}, {"destwidth", "3"}, {"destheight", "4"},
{"srcx", "2"}, {"srcy", "1"}, {"srcwidth", "4"}, {"srcheight", "3"},
- {"crc", "abd45514"}, {"transparenttype", "bitmap"}
+ {"crc", "5e01ddcc"}, {"transparenttype", "bitmap"}
});
#else
assertXPathAttrs(pDoc, "/metafile/bmpex[1]", {