vcl/opengl/salbmp.cxx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
New commits: commit c332ed4794dc0ae818416b36aa5295a9dd34c9c6 Author: Michael Meeks <michael.me...@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 Reviewed-on: https://gerrit.libreoffice.org/21295 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tor Lillqvist <t...@collabora.com> Tested-by: Tor Lillqvist <t...@collabora.com> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits