summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-09-28 04:59:23 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-09-28 04:59:23 (GMT)
commit3a927312dbb797f03b351067210b83784c7132cb (patch)
tree1ab3f32db3c454c1822b39bcd89be322e43fa80f /src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
parent8f9ef5ca1cd24bf74004c8b12e4025b72ec7548b (diff)
downloadQt-3a927312dbb797f03b351067210b83784c7132cb.zip
Qt-3a927312dbb797f03b351067210b83784c7132cb.tar.gz
Qt-3a927312dbb797f03b351067210b83784c7132cb.tar.bz2
Minimize parameter changes on glyph cache textures
Cache the last set filtering mode on glyph textures and update only when necessary. Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index f353995..9a5bac0 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -57,6 +57,7 @@ QGLTextureGlyphCache::QGLTextureGlyphCache(QGLContext *context, QFontEngineGlyph
, ctx(context)
, m_width(0)
, m_height(0)
+ , m_filterMode(Nearest)
{
// broken FBO readback is a bug in the SGX 1.3 and 1.4 drivers for the N900 where
// copying between FBO's is broken if the texture is either GL_ALPHA or POT. The
@@ -114,6 +115,9 @@ void QGLTextureGlyphCache::createTextureData(int width, int height)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ m_filterMode = Nearest;
}
void QGLTextureGlyphCache::resizeTextureData(int width, int height)
@@ -152,6 +156,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ m_filterMode = Nearest;
glBindTexture(GL_TEXTURE_2D, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, tmp_texture, 0);