From c60045ad8df097ebcb7efa89a5fc18b3a4614df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 14 May 2010 16:37:48 +0200 Subject: Limit the lower glyph texture cache size to 16x16 in GL. The SGX chip has a limitation regarding FBOs in that it doesn't support FBO sizes that are POT and less than 16 pixels in width/height. Since the FBO we use in the GL glyph cache always mirrors the size of the texture itself, we limit that instead to avoid creating invalid FBOs. Task-number: QTBUG-10645 Reviewed-by: Gunnar --- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index cc42c63..410cf21 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -91,6 +91,12 @@ void QGLTextureGlyphCache::createTextureData(int width, int height) if (ctx->d_ptr->workaround_brokenFBOReadBack && image().isNull()) QImageTextureGlyphCache::createTextureData(width, height); + // Make the lower glyph texture size 16 x 16. + if (width < 16) + width = 16; + if (height < 16) + height = 16; + glGenTextures(1, &m_texture); glBindTexture(GL_TEXTURE_2D, m_texture); @@ -115,6 +121,12 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) int oldWidth = m_width; int oldHeight = m_height; + // Make the lower glyph texture size 16 x 16. + if (width < 16) + width = 16; + if (height < 16) + height = 16; + GLuint oldTexture = m_texture; createTextureData(width, height); -- cgit v0.12