summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-06-12 12:05:22 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-06-12 12:41:52 (GMT)
commitd834d94bde645d43dd981154bd0ba99d8e81f040 (patch)
tree5164895fa6ba6582b40fe285296a680c409ff420 /src/opengl/gl2paintengineex/qglengineshadermanager.cpp
parent8a2993a6c53e1a5641bd1c500ad4bd54e799299b (diff)
downloadQt-d834d94bde645d43dd981154bd0ba99d8e81f040.zip
Qt-d834d94bde645d43dd981154bd0ba99d8e81f040.tar.gz
Qt-d834d94bde645d43dd981154bd0ba99d8e81f040.tar.bz2
Fixed incorrect rendering of bitmap/pattern brushes in GL 2 engine.
The pen color should be used when drawPixmap is called with a bitmap, and the brush color should be used for texture patterns that are bitmaps. Task-number: 245802 Reviewed-by: Trond
Diffstat (limited to 'src/opengl/gl2paintengineex/qglengineshadermanager.cpp')
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 5c541d0..b71c4c1 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -107,9 +107,11 @@ QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context)
code[MainFragmentShader] = qglslMainFragmentShader;
code[ImageSrcFragmentShader] = qglslImageSrcFragmentShader;
+ code[ImageSrcWithPatternFragmentShader] = qglslImageSrcWithPatternFragmentShader;
code[NonPremultipliedImageSrcFragmentShader] = qglslNonPremultipliedImageSrcFragmentShader;
code[SolidBrushSrcFragmentShader] = qglslSolidBrushSrcFragmentShader;
code[TextureBrushSrcFragmentShader] = qglslTextureBrushSrcFragmentShader;
+ code[TextureBrushSrcWithPatternFragmentShader] = qglslTextureBrushSrcWithPatternFragmentShader;
code[PatternBrushSrcFragmentShader] = qglslPatternBrushSrcFragmentShader;
code[LinearGradientBrushSrcFragmentShader] = qglslLinearGradientBrushSrcFragmentShader;
code[RadialGradientBrushSrcFragmentShader] = qglslRadialGradientBrushSrcFragmentShader;
@@ -296,6 +298,15 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
srcPixelFragShaderName = ImageSrcFragmentShader;
positionVertexShaderName = PositionOnlyVertexShader;
break;
+ case QGLEngineShaderManager::PatternSrc:
+ srcPixelFragShaderName = ImageSrcWithPatternFragmentShader;
+ positionVertexShaderName = PositionOnlyVertexShader;
+ break;
+ case QGLEngineShaderManager::TextureSrcWithPattern:
+ srcPixelFragShaderName = TextureBrushSrcWithPatternFragmentShader;
+ positionVertexShaderName = isAffine ? AffinePositionWithTextureBrushVertexShader
+ : PositionWithTextureBrushVertexShader;
+ break;
case QGLEngineShaderManager::NonPremultipliedImageSrc:
srcPixelFragShaderName = NonPremultipliedImageSrcFragmentShader;
positionVertexShaderName = PositionOnlyVertexShader;