diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-04-20 11:46:42 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-04-20 11:46:42 (GMT) |
commit | 0c7348cbc5fbbd06ff6752d98e5a6506b8cb5ffa (patch) | |
tree | bc6c53a28dd7677617d731521ddba4c9c0a404fd /src/opengl/gl2paintengineex/qglengineshadersource_p.h | |
parent | 4701bc6fa8fe47d5038ed0a86a4e6c0490c259fe (diff) | |
download | Qt-0c7348cbc5fbbd06ff6752d98e5a6506b8cb5ffa.zip Qt-0c7348cbc5fbbd06ff6752d98e5a6506b8cb5ffa.tar.gz Qt-0c7348cbc5fbbd06ff6752d98e5a6506b8cb5ffa.tar.bz2 |
Refactor opacity handling & make drawImage/drawPixmap work again
Diffstat (limited to 'src/opengl/gl2paintengineex/qglengineshadersource_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadersource_p.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index 7557431..2c284cb 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -79,13 +79,13 @@ static const char* const qglslMainVertexShader = "\ }"; static const char* const qglslMainWithTexCoordsVertexShader = "\ - attribute lowp vec2 textureCoord; \ - varying lowp vec2 fragTextureCoord; \ + attribute lowp vec2 textureCoordArray; \ + varying lowp vec2 textureCoords; \ void setPosition();\ void main(void) \ {\ setPosition();\ - fragTextureCoord = textureCoord; \ + textureCoords = textureCoordArray; \ }"; @@ -243,7 +243,7 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\ uniform mediump vec2 halfViewportSize; \ uniform mediump vec2 invertedTextureSize; \ uniform mediump mat3 brushTransform; \ - varying mediump vec2 textureTexCoords; \ + varying mediump vec2 brushTextureCoords; \ void setPosition(void) { \ gl_Position = pmvMatrix * inputVertex;\ gl_Position.xy = gl_Position.xy / gl_Position.w; \ @@ -252,18 +252,18 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \ gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \ gl_Position.w = invertedHTexCoordsZ; \ - textureTexCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \ - textureTexCoords.y = -textureTexCoords.y; \ + brushTextureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \ + brushTextureCoords.y = -brushTextureCoords.y; \ }"; static const char* const qglslAffinePositionWithTextureBrushVertexShader = qglslPositionWithTextureBrushVertexShader; static const char* const qglslTextureBrushSrcFragmentShader = "\ - varying mediump vec2 textureTexCoords; \ + varying mediump vec2 brushTextureCoords; \ uniform sampler2D brushTexture; \ lowp vec4 srcPixel() { \ - return texture2D(brushTexture, textureTexCoords); \ + return texture2D(brushTexture, brushTextureCoords); \ }"; @@ -275,17 +275,17 @@ static const char* const qglslSolidBrushSrcFragmentShader = "\ }"; static const char* const qglslImageSrcFragmentShader = "\ - varying highp vec2 texCoord; \ - uniform sampler2D textureSampler; \ + varying highp vec2 textureCoords; \ + uniform sampler2D imageTexture; \ lowp vec4 srcPixel() { \ - return texture2D(textureSampler, texCoord); \ + return texture2D(imageTexture, textureCoords); \ }"; static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\ - varying highp vec2 texCoord; \ - uniform sampler2D textureSampler; \ + varying highp vec2 textureCoords; \ + uniform sampler2D imageTexture; \ lowp vec4 srcPixel() { \ - lowp vec4 sample = texture2D(textureSampler, texCoord); \ + lowp vec4 sample = texture2D(imageTexture, textureCoords); \ sample.rgb = sample.rgb * sample.a; \ return sample; \ }"; |