[Libreoffice-commits] core.git: vcl/opengl
Michael Meeks
michael.meeks at collabora.com
Sat Jan 9 13:16:25 PST 2016
vcl/opengl/salbmp.cxx | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
New commits:
commit 33208c347182d8fe80bfbe34fe3e0b4b21a0a7a2
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Sat Jan 9 21:25:12 2016 +0000
tdf#96550 - vcl opengl - fix BGR/RGB swap for some 8-bit icons.
Change-Id: Ic71b8a94cabc392e7b83df70c1691de8f4c12b43
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 9e59e23..03497dc 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;
More information about the Libreoffice-commits
mailing list