From 36818ae9ef7eba9f93ba33c6ad21a333956c08f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 2 Dec 2014 18:31:38 +0100 Subject: [PATCH] Collate calls to updateTextureFilter in updateBrushTexture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id13d5bc122c4f9cc8f44ff82df345a50f2944118 Reviewed-by: Laszlo Agocs Reviewed-by: Tor Arne Vestbø --- src/gui/opengl/qopenglpaintengine.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index 503e869a36..b18d2cc42a 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -202,12 +202,13 @@ void QOpenGL2PaintEngineExPrivate::updateBrushTexture() funcs.glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); funcs.glBindTexture(GL_TEXTURE_2D, texId); + GLenum wrapMode = GL_CLAMP_TO_EDGE; if (g->spread() == QGradient::RepeatSpread || g->type() == QGradient::ConicalGradient) - updateTextureFilter(GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); + wrapMode = GL_REPEAT; else if (g->spread() == QGradient::ReflectSpread) - updateTextureFilter(GL_MIRRORED_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); - else - updateTextureFilter(GL_CLAMP_TO_EDGE, q->state()->renderHints & QPainter::SmoothPixmapTransform); + wrapMode = GL_MIRRORED_REPEAT; + + updateTextureFilter(wrapMode, q->state()->renderHints & QPainter::SmoothPixmapTransform); } else if (style == Qt::TexturePattern) { currentBrushImage = currentBrush.textureImage();