summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-01-11 14:43:52 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-01-11 14:51:57 (GMT)
commitf9a6458f4abf8327354d227b3dd87bbab50d44e9 (patch)
tree93ab3cd5c58b414281e5167b1ef1cdb0baf27672 /src/opengl
parentdfcc48e9201dd64cce696248a9938d541a1a8cad (diff)
downloadQt-f9a6458f4abf8327354d227b3dd87bbab50d44e9.zip
Qt-f9a6458f4abf8327354d227b3dd87bbab50d44e9.tar.gz
Qt-f9a6458f4abf8327354d227b3dd87bbab50d44e9.tar.bz2
Fixed justify aligned text drawing with the GL1 engine.
The text was blurry because it wasn't pixel aligned. Fixed by using nearest-neighbour texture filtering when using only translations on the painter. Reviewed-by: Trond
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qpaintengine_opengl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 8dae02a..d20f96c 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -4931,7 +4931,8 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- bool antialias = !(ti.fontEngine->fontDef.styleStrategy & QFont::NoAntialias);
+ bool antialias = !(ti.fontEngine->fontDef.styleStrategy & QFont::NoAntialias)
+ && (d->matrix.type() > QTransform::TxTranslate);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, antialias ? GL_LINEAR : GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, antialias ? GL_LINEAR : GL_NEAREST);