From cde22222cff549c63045eec968c80c9db0c523f2 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Mon, 11 Aug 2014 10:18:04 +0200 Subject: Mirror vertically the texture bitmaps for OpenGL In case of glTF models it saves a Mirror() call. In case of OpenGL charts it avoid flipped texts. Change-Id: I1ac980e16bcb5ba6a9a025b638aaac3b08b4aab3 --- vcl/source/opengl/OpenGLHelper.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl/source/opengl/OpenGLHelper.cxx') diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index c028246b8b06..16dd5b7a9411 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -146,7 +146,7 @@ GLint OpenGLHelper::LoadShaders(const OUString& rVertexShaderName,const OUString return ProgramID; } -void OpenGLHelper::ConvertBitmapExToRGBABuffer(const BitmapEx& rBitmapEx, sal_uInt8* o_pRGBABuffer) +void OpenGLHelper::ConvertBitmapExToRGBATextureBuffer(const BitmapEx& rBitmapEx, sal_uInt8* o_pRGBABuffer) { long nBmpWidth = rBitmapEx.GetSizePixel().Width(); long nBmpHeight = rBitmapEx.GetSizePixel().Height(); @@ -156,7 +156,7 @@ void OpenGLHelper::ConvertBitmapExToRGBABuffer(const BitmapEx& rBitmapEx, sal_uI Bitmap::ScopedReadAccess pReadAccces( aBitmap ); AlphaMask::ScopedReadAccess pAlphaReadAccess( aAlpha ); size_t i = 0; - for (long ny = 0; ny < nBmpHeight; ny++) + for (long ny = nBmpHeight - 1; ny >= 0; ny--) { Scanline pAScan = pAlphaReadAccess ? pAlphaReadAccess->GetScanline(ny) : 0; for(long nx = 0; nx < nBmpWidth; nx++) -- cgit