Kaydet (Commit) de55aa0f authored tarafından Dennis Francis's avatar Dennis Francis

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/42194Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst a952d1f5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment