summaryrefslogtreecommitdiff
path: root/vcl/inc/headless
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/inc/headless
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/inc/headless')
-rw-r--r--vcl/inc/headless/svpgdi.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 8204538cb132..b14be042ed67 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -38,19 +38,23 @@
//which is internal in that case, to swap the rgb components so that
//cairo then matches the OpenGL GL_RGBA format so we can use it there
//where we don't have GL_BGRA support.
+// SVP_24BIT_FORMAT is used to store 24-bit images in 3-byte pixels to conserve memory.
#if defined ANDROID
+# define SVP_24BIT_FORMAT (ScanlineFormat::N24BitTcRgb | ScanlineFormat::TopDown)
# define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcRgba | ScanlineFormat::TopDown)
# define SVP_CAIRO_BLUE 1
# define SVP_CAIRO_GREEN 2
# define SVP_CAIRO_RED 0
# define SVP_CAIRO_ALPHA 3
#elif defined OSL_BIGENDIAN
+# define SVP_24BIT_FORMAT (ScanlineFormat::N24BitTcRgb | ScanlineFormat::TopDown)
# define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcArgb | ScanlineFormat::TopDown)
# define SVP_CAIRO_BLUE 3
# define SVP_CAIRO_GREEN 2
# define SVP_CAIRO_RED 1
# define SVP_CAIRO_ALPHA 0
#else
+# define SVP_24BIT_FORMAT (ScanlineFormat::N24BitTcBgr | ScanlineFormat::TopDown)
# define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcBgra | ScanlineFormat::TopDown)
# define SVP_CAIRO_BLUE 0
# define SVP_CAIRO_GREEN 1