[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - vcl/opengl
Dennis Francis
dennis.francis at collabora.co.uk
Wed Sep 13 07:56:02 UTC 2017
vcl/opengl/salbmp.cxx | 14 ++++++++++++++
1 file changed, 14 insertions(+)
New commits:
commit 6d5d07c1ac00af40858effe8d075a16c016a08fc
Author: Dennis Francis <dennis.francis at collabora.co.uk>
Date: Tue Sep 12 15:47:58 2017 +0530
tdf#108299: Limit the width and height of opengl bitmap to...
GL_MAX_TEXTURE_SIZE in OpenGLSalBitmap::Create()
Change-Id: I3d9538cc8004241972bc63d09eeb2914ce511df6
Reviewed-on: https://gerrit.libreoffice.org/42194
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Jenkins <ci at libreoffice.org>
(cherry picked from commit de55aa0f639a451aae05ec515cfa58d4bbdd8816)
Reviewed-on: https://gerrit.libreoffice.org/42226
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 5c94dfdaa2a9..aed6adfef963 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -124,6 +124,20 @@ bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long
VCL_GL_INFO( "OpenGLSalBitmap::Create from FBO: ["
<< nX << ", " << nY << "] " << nWidth << "x" << nHeight );
+ GLint nMaxTextureSize;
+ glGetIntegerv( GL_MAX_TEXTURE_SIZE, &nMaxTextureSize );
+ if ( nWidth > nMaxTextureSize )
+ {
+ nWidth = nMaxTextureSize;
+ VCL_GL_INFO( "Width limited to " << nMaxTextureSize );
+ }
+
+ if ( nHeight > nMaxTextureSize )
+ {
+ nHeight = nMaxTextureSize;
+ VCL_GL_INFO( "Height limited to " << nMaxTextureSize );
+ }
+
mnWidth = nWidth;
mnHeight = nHeight;
More information about the Libreoffice-commits
mailing list