[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - vcl/headless vcl/inc
David Tardon
dtardon at redhat.com
Wed Jun 29 14:43:47 UTC 2016
vcl/headless/svpgdi.cxx | 6 ++++++
vcl/inc/headless/svpgdi.hxx | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
New commits:
commit d0a111a397e8fe882ebb7b0431ff4077c611c66f
Author: David Tardon <dtardon at redhat.com>
Date: Mon Jun 27 14:17:38 2016 -0400
rhbz#1341064 fix OutputDevice test on big endian systems
Change-Id: I902acd90797ab26304bc5b239b862cae9f3075ef
(cherry picked from commit e9ef81eeefba5c4ec6de3fe72aefb6af26de30c4)
Reviewed-on: https://gerrit.libreoffice.org/26758
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 2cbfb23..2ddc8e5 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1125,9 +1125,15 @@ SalColor SvpSalGraphics::getPixel( long nX, long nY )
unsigned char *surface_data = cairo_image_surface_get_data(m_pSurface);
unsigned char *row = surface_data + (nStride*nY);
unsigned char *data = row + (nX * 4);
+# if defined OSL_BIGENDIAN
+ sal_uInt8 b = unpremultiply(data[3], data[0]);
+ sal_uInt8 g = unpremultiply(data[2], data[0]);
+ sal_uInt8 r = unpremultiply(data[1], data[0]);
+#else
sal_uInt8 b = unpremultiply(data[0], data[3]);
sal_uInt8 g = unpremultiply(data[1], data[3]);
sal_uInt8 r = unpremultiply(data[2], data[3]);
+#endif
return MAKE_SALCOLOR(r, g, b);
}
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index dc88a60..0d88195 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -37,8 +37,10 @@
//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.
-#ifdef ANDROID
+#if defined ANDROID
# define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcRgba | ScanlineFormat::TopDown)
+#elif defined OSL_BIGENDIAN
+# define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcArgb | ScanlineFormat::TopDown)
#else
# define SVP_CAIRO_FORMAT (ScanlineFormat::N32BitTcBgra | ScanlineFormat::TopDown)
#endif
More information about the Libreoffice-commits
mailing list