summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-09 14:10:00 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-09 14:10:00 (GMT)
commit004b09ffd423cd3100e346825dd7d730fc86d366 (patch)
tree445304eb7b6e5e5129cbbf5b2e1fba05bf027539 /src/opengl
parentd92f8dd19a2f52771063faf0b926faa22149a206 (diff)
downloadQt-004b09ffd423cd3100e346825dd7d730fc86d366.zip
Qt-004b09ffd423cd3100e346825dd7d730fc86d366.tar.gz
Qt-004b09ffd423cd3100e346825dd7d730fc86d366.tar.bz2
Make the GL glyph cache a POT texture
This is a significant speed-up on some architectures and drivers.
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp6
1 files changed, 5 insertions, 1 deletions
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);