summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2010-11-24 08:44:31 +0100
committerGunnar Sletta <gunnar.sletta@nokia.com>2010-11-24 08:44:31 +0100
commit5ca7e1aea44ea92a44e41041de868270d06480db (patch)
tree8191dfab6021e6bdf2cd9628af33cdb412d9e08c
parent9a22b0987d916b7b12d0cf444bcae8f213c43cfa (diff)
Use linear sampling for the text textures.
Otherwise, scaling looks really bad...
-rw-r--r--src/adaptationlayers/default/default_glyphnode_p.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/adaptationlayers/default/default_glyphnode_p.cpp b/src/adaptationlayers/default/default_glyphnode_p.cpp
index 94a02d3..e6b083f 100644
--- a/src/adaptationlayers/default/default_glyphnode_p.cpp
+++ b/src/adaptationlayers/default/default_glyphnode_p.cpp
@@ -142,6 +142,13 @@ void TextMaskMaterialData::updateEffectState(Renderer *renderer, AbstractEffect
m_program.setUniformValue(m_textureScale_id, QVector2D(1.0 / material->cacheTextureWidth(),
1.0 / material->cacheTextureHeight()));
renderer->setTexture(0, material->texture().data());
+
+ // Set the mag/min filters to be linear. We only need to do this when the texture
+ // has been recreated.
+ if (updated) {
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ }
}
}
@@ -306,7 +313,6 @@ bool TextMaskMaterial::ensureUpToDate()
m_texture = QGLTexture2DPtr(QGLTexture2D::fromTextureId(glyphCache()->texture(),
QSize(glyphCache()->width(),
glyphCache()->height())));
-
m_size = glyphCacheSize;
return true;