diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-06-12 12:05:22 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-06-12 12:41:52 (GMT) |
commit | d834d94bde645d43dd981154bd0ba99d8e81f040 (patch) | |
tree | 5164895fa6ba6582b40fe285296a680c409ff420 /src/opengl/gl2paintengineex/qglengineshadersource_p.h | |
parent | 8a2993a6c53e1a5641bd1c500ad4bd54e799299b (diff) | |
download | Qt-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/qglengineshadersource_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadersource_p.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index 70cc67e..61cc63e 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -130,7 +130,7 @@ static const char* const qglslPatternBrushSrcFragmentShader = "\ uniform lowp vec4 patternColor; \ varying mediump vec2 patternTexCoords;\ lowp vec4 srcPixel() { \ - return patternColor * texture2D(brushTexture, patternTexCoords).r; \ + return patternColor * (1.0 - texture2D(brushTexture, patternTexCoords).r); \ }\n"; @@ -278,6 +278,13 @@ static const char* const qglslTextureBrushSrcFragmentShader = "\ return texture2D(brushTexture, brushTextureCoords); \ }"; +static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\ + varying mediump vec2 brushTextureCoords; \ + uniform lowp vec4 patternColor; \ + uniform sampler2D brushTexture; \ + lowp vec4 srcPixel() { \ + return patternColor * (1.0 - texture2D(brushTexture, brushTextureCoords).r); \ + }"; // Solid Fill Brush static const char* const qglslSolidBrushSrcFragmentShader = "\ @@ -293,6 +300,14 @@ static const char* const qglslImageSrcFragmentShader = "\ return texture2D(imageTexture, textureCoords); \ }"; +static const char* const qglslImageSrcWithPatternFragmentShader = "\ + varying highp vec2 textureCoords; \ + uniform lowp vec4 patternColor; \ + uniform sampler2D imageTexture; \ + lowp vec4 srcPixel() { \ + return patternColor * (1.0 - texture2D(imageTexture, textureCoords).r); \ + }\n"; + static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\ varying highp vec2 textureCoords; \ uniform sampler2D imageTexture; \ |