From d2f8e1ebbf7b5bb0e143ac797eccb9d059173676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 10 Sep 2009 13:38:58 +0200 Subject: 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 --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 9 ++++----- 1 file 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) { -- cgit v0.12