vcl/opengl/salbmp.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
New commits: commit de55aa0f639a451aae05ec515cfa58d4bbdd8816 Author: Dennis Francis <[email protected]> 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 <[email protected]> Tested-by: Jenkins <[email protected]> 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; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
