summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-04-14 18:21:04 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-04-16 13:43:45 +0200
commit0555bda4856626f520a14c33fa5ba8ff8dcb0ac8 (patch)
tree2cac86f5637fecd032afe5996de70d95e34e783f /vcl/opengl
parent2ef36289c78f4eb1ed25b5cf3913c441760aa111 (diff)
make ConvertBGRABufferToBitmapEx work properly also on non-win32
Windows uses GL_BGRA, but e.g. on Linux OpenGL stores as GL_RGBA. Change-Id: I00820f7b7a16a54b10c682ba332627ec04648508 Reviewed-on: https://gerrit.libreoffice.org/70772 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/texture.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index 6536141c8134..19b48967e314 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -498,8 +498,8 @@ void OpenGLTexture::Unbind()
void OpenGLTexture::SaveToFile(const OUString& rFileName)
{
std::vector<sal_uInt8> aBuffer(GetWidth() * GetHeight() * 4);
- Read(GL_BGRA, GL_UNSIGNED_BYTE, aBuffer.data());
- BitmapEx aBitmap = OpenGLHelper::ConvertBGRABufferToBitmapEx(aBuffer.data(), GetWidth(), GetHeight());
+ Read(OpenGLHelper::OptimalBufferFormat(), GL_UNSIGNED_BYTE, aBuffer.data());
+ BitmapEx aBitmap = OpenGLHelper::ConvertBufferToBitmapEx(aBuffer.data(), GetWidth(), GetHeight());
try
{
vcl::PNGWriter aWriter(aBitmap);