summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-06-27 14:17:38 -0400
committerDavid Tardon <dtardon@redhat.com>2016-06-28 14:52:40 -0400
commite9ef81eeefba5c4ec6de3fe72aefb6af26de30c4 (patch)
treee8f2511407dabfb4d0f36e2e99e69a74787016fc /vcl
parent0cb200d000fad8ba31c7400e08cd031823f27308 (diff)
rhbz#1341064 fix OutputDevice test on big endian systems
Change-Id: I902acd90797ab26304bc5b239b862cae9f3075ef
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/svpgdi.cxx6
-rw-r--r--vcl/inc/headless/svpgdi.hxx4
2 files changed, 9 insertions, 1 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 34fa731e7396..511a42737218 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 bb2e2f51f972..1bd4b65c7bf2 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