diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-07-21 12:39:30 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-07-21 13:54:52 (GMT) |
commit | 89038235d08a039145792e545c3efedfd3d93323 (patch) | |
tree | 7b45c5b042478ca3c311e6ba30db3a999a03e7b3 /src/opengl/gl2paintengineex | |
parent | 492a32d53f31a0617f0aac45aad3e8a5c9e3f5ed (diff) | |
download | Qt-89038235d08a039145792e545c3efedfd3d93323.zip Qt-89038235d08a039145792e545c3efedfd3d93323.tar.gz Qt-89038235d08a039145792e545c3efedfd3d93323.tar.bz2 |
Fixed gradient bug in the GL2 paint engine.
Texture filtering was set before binding the texture, so the gradient
spread was not set correctly.
Reviewed-by: Tom
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 3007b4c..fa6b966 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -364,15 +364,15 @@ void QGL2PaintEngineExPrivate::updateBrushTexture() // for opacity to the cache. GLuint texId = QGL2GradientCache::cacheForContext(ctx)->getBuffer(*g, 1.0); + glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); + glBindTexture(GL_TEXTURE_2D, texId); + if (g->spread() == QGradient::RepeatSpread || g->type() == QGradient::ConicalGradient) updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, true); else if (g->spread() == QGradient::ReflectSpread) updateTextureFilter(GL_TEXTURE_2D, GL_MIRRORED_REPEAT_IBM, true); else updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, true); - - glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); - glBindTexture(GL_TEXTURE_2D, texId); } else if (style == Qt::TexturePattern) { const QPixmap& texPixmap = currentBrush->texture(); |