From 004b09ffd423cd3100e346825dd7d730fc86d366 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 9 Feb 2010 15:10:00 +0100 Subject: Make the GL glyph cache a POT texture This is a significant speed-up on some architectures and drivers. --- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 6cb76ee..53c627f 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -70,8 +70,12 @@ QGLTextureGlyphCache::~QGLTextureGlyphCache() } } -void QGLTextureGlyphCache::createTextureData(int width, int height) +void QGLTextureGlyphCache::createTextureData(int width, int unalteredHeight) { + extern int qt_next_power_of_two(int v); + // Set height to lowest POT number which is higher than or equal to height + int height = qt_next_power_of_two(unalteredHeight); + glGenTextures(1, &m_texture); glBindTexture(GL_TEXTURE_2D, m_texture); -- cgit v0.12