summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2017-09-12 15:47:58 +0530
committerDennis Francis <dennis.francis@collabora.co.uk>2017-09-12 14:39:25 +0200
commitde55aa0f639a451aae05ec515cfa58d4bbdd8816 (patch)
treeba8bc851aec2578c67001a2ab4c3bd51fab23eb5 /vcl/opengl
parenta952d1f59f4f84380b82f1eb9e550b8f69c4be5d (diff)
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@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/salbmp.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 01072929beb2..4eb1f2714cd8 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;