diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2013-10-19 14:21:31 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-21 19:10:50 +0200 |
commit | de31a57672ec461c2081f65e3631134ee45de887 (patch) | |
tree | 98678959c8af0bc36629c97ecf0c2ede77e05db2 /src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | |
parent | a3f01331263eddbc502fb88734568ac38df5e316 (diff) |
Don't use reserved keyword "texture" as uniform variable name
The "texture" keyword is a function name in OpenGL core profile. This
commit is in preparation for making the Qt Quick 2 renderer and
materials work with a core profile context.
Change-Id: Iad243e64ab8db739fc46b85bb626bdb8b9ceb208
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultglyphnode_p.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 50009d7709..39d9832f58 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -101,10 +101,10 @@ const char *QSGTextMaskShader::vertexShader() const { const char *QSGTextMaskShader::fragmentShader() const { return "varying highp vec2 sampleCoord; \n" - "uniform sampler2D texture; \n" + "uniform sampler2D _qt_texture; \n" "uniform lowp vec4 color; \n" "void main() { \n" - " lowp vec4 glyph = texture2D(texture, sampleCoord); \n" + " lowp vec4 glyph = texture2D(_qt_texture, sampleCoord); \n" " gl_FragColor = vec4(glyph.rgb * color.a, glyph.a); \n" "}"; } @@ -389,14 +389,14 @@ const char *QSGStyledTextShader::fragmentShader() const return "varying highp vec2 sampleCoord; \n" "varying highp vec2 shiftedSampleCoord; \n" - "uniform sampler2D texture; \n" + "uniform sampler2D _qt_texture; \n" "uniform lowp vec4 color; \n" "uniform lowp vec4 styleColor; \n" - "void main() { \n" - " lowp float glyph = texture2D(texture, sampleCoord).a; \n" - " lowp float style = clamp(texture2D(texture, shiftedSampleCoord).a - glyph, \n" - " 0.0, 1.0); \n" - " gl_FragColor = style * styleColor + glyph * color; \n" + "void main() { \n" + " lowp float glyph = texture2D(_qt_texture, sampleCoord).a; \n" + " lowp float style = clamp(texture2D(_qt_texture, shiftedSampleCoord).a - glyph, \n" + " 0.0, 1.0); \n" + " gl_FragColor = style * styleColor + glyph * color; \n" "}"; } @@ -444,18 +444,18 @@ const char *QSGOutlinedTextShader::fragmentShader() const "varying highp vec2 sCoordDown; \n" "varying highp vec2 sCoordLeft; \n" "varying highp vec2 sCoordRight; \n" - "uniform sampler2D texture; \n" + "uniform sampler2D _qt_texture; \n" "uniform lowp vec4 color; \n" "uniform lowp vec4 styleColor; \n" - "void main() { \n" - "lowp float glyph = texture2D(texture, sampleCoord).a; \n" - " lowp float outline = clamp(clamp(texture2D(texture, sCoordUp).a + \n" - " texture2D(texture, sCoordDown).a + \n" - " texture2D(texture, sCoordLeft).a + \n" - " texture2D(texture, sCoordRight).a, \n" - " 0.0, 1.0) - glyph, \n" - " 0.0, 1.0); \n" - " gl_FragColor = outline * styleColor + glyph * color; \n" + "void main() { \n" + "lowp float glyph = texture2D(_qt_texture, sampleCoord).a; \n" + " lowp float outline = clamp(clamp(texture2D(_qt_texture, sCoordUp).a + \n" + " texture2D(_qt_texture, sCoordDown).a + \n" + " texture2D(_qt_texture, sCoordLeft).a + \n" + " texture2D(_qt_texture, sCoordRight).a, \n" + " 0.0, 1.0) - glyph, \n" + " 0.0, 1.0); \n" + " gl_FragColor = outline * styleColor + glyph * color; \n" "}"; } |