summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2014-12-02 18:31:38 +0100
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2014-12-04 18:51:39 +0100
commit36818ae9ef7eba9f93ba33c6ad21a333956c08f7 (patch)
treecad89d64a1fee4ed566d0635467a9423a9647b50 /src/gui/opengl
parentfd29be6a6beafe4bfaf5a73d19a0d6a924217d16 (diff)
Collate calls to updateTextureFilter in updateBrushTexture
Change-Id: Id13d5bc122c4f9cc8f44ff82df345a50f2944118 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp9
1 files 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();