summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-06-27 20:37:25 +0200
committerDavid Tardon <dtardon@redhat.com>2016-06-28 14:52:57 -0400
commitcff87aac4ec77957569377d690bc4aa8f7146e0d (patch)
tree99af78fa13528f37cd7e289a076ea9bb1153cb52 /canvas
parente9ef81eeefba5c4ec6de3fe72aefb6af26de30c4 (diff)
update other places that read data from cairo image surface
Change-Id: Icb8761e5ff89e1c0e0e034a751fe9a50ad5ab90a
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_canvasbitmap.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/canvas/source/cairo/cairo_canvasbitmap.cxx b/canvas/source/cairo/cairo_canvasbitmap.cxx
index 37c8902fe017..86020acaefe3 100644
--- a/canvas/source/cairo/cairo_canvasbitmap.cxx
+++ b/canvas/source/cairo/cairo_canvasbitmap.cxx
@@ -152,10 +152,17 @@ namespace cairocanvas
sal_uInt32 *pPix = reinterpret_cast<sal_uInt32 *>(pSrc + nStride * y);
for( unsigned long x = 0; x < (unsigned long) aSize.Width(); x++ )
{
+#if defined OSL_BIGENDIAN
+ sal_uInt8 nB = (*pPix >> 24);
+ sal_uInt8 nG = (*pPix >> 16) & 0xff;
+ sal_uInt8 nR = (*pPix >> 8) & 0xff;
+ sal_uInt8 nAlpha = *pPix & 0xff;
+#else
sal_uInt8 nAlpha = (*pPix >> 24);
sal_uInt8 nR = (*pPix >> 16) & 0xff;
sal_uInt8 nG = (*pPix >> 8) & 0xff;
sal_uInt8 nB = *pPix & 0xff;
+#endif
if( nAlpha != 0 && nAlpha != 255 )
{
// Cairo uses pre-multiplied alpha - we do not => re-multiply