summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-10 11:38:58 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-09-10 11:45:16 (GMT)
commitd2f8e1ebbf7b5bb0e143ac797eccb9d059173676 (patch)
treeaec141a08332fae74d213d40539533fbf2026877 /src
parent914cebd0c8db1a09ca3d2809a08369b2206f76dd (diff)
downloadQt-d2f8e1ebbf7b5bb0e143ac797eccb9d059173676.zip
Qt-d2f8e1ebbf7b5bb0e143ac797eccb9d059173676.tar.gz
Qt-d2f8e1ebbf7b5bb0e143ac797eccb9d059173676.tar.bz2
Fixed rendering of text with gradient pen in GL 2 engine.
We should bind the text mask texture after calling prepareForDraw(), since prepareForDraw() might need to initialize the gradient texture, which means the text mask will no longer be bound. Task-number: 261058 Reviewed-by: Kim
Diffstat (limited to 'src')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index f8095bf..2eacef0 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1278,15 +1278,15 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, const QTextIte
textureCoordinateArray.addRect(QRectF(c.x*dx, c.y*dy, c.w * dx, c.h * dy));
}
- glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
- glBindTexture(GL_TEXTURE_2D, cache->texture());
- updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
-
QBrush pensBrush = q->state()->pen.brush();
setBrush(&pensBrush);
prepareForDraw(false); // Text always causes src pixels to be transparent
+ glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT);
+ glBindTexture(GL_TEXTURE_2D, cache->texture());
+ updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
+
#ifndef QT_OPENGL_ES_2
if (inRenderText)
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::Depth), zValueForRenderText());
@@ -1346,7 +1346,6 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->needsSync = true;
d->use_system_clip = !systemClip().isEmpty();
-
d->device->beginPaint();
if (!d->inRenderText) {