summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-01-09 21:25:12 +0000
committerMichael Meeks <michael.meeks@collabora.com>2016-01-09 21:26:59 +0000
commit33208c347182d8fe80bfbe34fe3e0b4b21a0a7a2 (patch)
treec560cf4671eb54f8f4bd28934f4dd6fb52d44dfb /vcl/opengl
parent9921bae92ebfe1f1372fb4158a51a6f70ea738bd (diff)
tdf#96550 - vcl opengl - fix BGR/RGB swap for some 8-bit icons.
Change-Id: Ic71b8a94cabc392e7b83df70c1691de8f4c12b43
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/salbmp.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 9e59e231c1ec..03497dc44921 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -472,13 +472,25 @@ GLuint OpenGLSalBitmap::CreateTexture()
pSrcFormat->StartLine( pSrcData );
sal_uInt32 nX = mnBufWidth;
- while( nX-- )
+ if (nFormat == GL_BGR)
{
- const BitmapColor& c = pSrcFormat->ReadPixel();
-
- *pDstData++ = c.GetRed();
- *pDstData++ = c.GetGreen();
- *pDstData++ = c.GetBlue();
+ while( nX-- )
+ {
+ const BitmapColor& c = pSrcFormat->ReadPixel();
+ *pDstData++ = c.GetBlue();
+ *pDstData++ = c.GetGreen();
+ *pDstData++ = c.GetRed();
+ }
+ }
+ else // RGB
+ {
+ while( nX-- )
+ {
+ const BitmapColor& c = pSrcFormat->ReadPixel();
+ *pDstData++ = c.GetRed();
+ *pDstData++ = c.GetGreen();
+ *pDstData++ = c.GetBlue();
+ }
}
pSrcData += mnBytesPerRow;