[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - vcl/opengl

Miklos Vajna vmiklos at collabora.co.uk
Thu May 3 20:04:36 UTC 2018


 vcl/opengl/salbmp.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 443b2e6359955b107ba951636b2491b9444d0fee
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Apr 27 15:39:32 2018 +0200

    tdf#116365 vcl opengl: respect max texture size when creating textures
    
    I can't reproduce the crash, but the image in the bugdoc is a large one
    (23100 x 1364 pixels) and it was black for me. It's rendered correctly
    now.
    
    (cherry picked from commit a3cbd06872b2f9ee9253e5879f590ff1b9eaf365)
    
    Change-Id: I72c395af12ef88cf1352602492b84e1dcd04ed14
    Reviewed-on: https://gerrit.libreoffice.org/53771
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 6a032200670e..1ae3e2ae4a01 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -171,6 +171,15 @@ bool OpenGLSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapP
     mnBits = nBits;
     mnWidth = rSize.Width();
     mnHeight = rSize.Height();
+
+    // Limit size to what GL allows, so later glTexImage2D() won't fail.
+    GLint nMaxTextureSize;
+    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &nMaxTextureSize);
+    if (mnWidth > nMaxTextureSize)
+        mnWidth = nMaxTextureSize;
+    if (mnHeight > nMaxTextureSize)
+        mnHeight = nMaxTextureSize;
+
     return false;
 }
 


More information about the Libreoffice-commits mailing list