diff options
author | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-05-14 14:37:48 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-05-14 14:37:48 (GMT) |
commit | c60045ad8df097ebcb7efa89a5fc18b3a4614df6 (patch) | |
tree | 9e80551bad6da48a5437fb93ee9315e52ad45e83 /src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | |
parent | 9a69656bd64016933124813ea5403e7e5d454719 (diff) | |
download | Qt-c60045ad8df097ebcb7efa89a5fc18b3a4614df6.zip Qt-c60045ad8df097ebcb7efa89a5fc18b3a4614df6.tar.gz Qt-c60045ad8df097ebcb7efa89a5fc18b3a4614df6.tar.bz2 |
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
Diffstat (limited to 'src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp')
-rw-r--r-- | src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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); |