diff options
Diffstat (limited to 'src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp index 0cf7abed2e..125243847a 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp @@ -96,15 +96,15 @@ const char *QSGDistanceFieldTextMaterialShader::vertexShader() const { const char *QSGDistanceFieldTextMaterialShader::fragmentShader() const { return - "varying highp vec2 sampleCoord; \n" - "uniform mediump sampler2D texture; \n" - "uniform lowp vec4 color; \n" - "uniform mediump float alphaMin; \n" - "uniform mediump float alphaMax; \n" - "void main() { \n" - " gl_FragColor = color * smoothstep(alphaMin, \n" - " alphaMax, \n" - " texture2D(texture, sampleCoord).a); \n" + "varying highp vec2 sampleCoord; \n" + "uniform mediump sampler2D _qt_texture; \n" + "uniform lowp vec4 color; \n" + "uniform mediump float alphaMin; \n" + "uniform mediump float alphaMax; \n" + "void main() { \n" + " gl_FragColor = color * smoothstep(alphaMin, \n" + " alphaMax, \n" + " texture2D(_qt_texture, sampleCoord).a); \n" "}"; } @@ -366,7 +366,7 @@ protected: const char *DistanceFieldOutlineTextMaterialShader::fragmentShader() const { return "varying highp vec2 sampleCoord; \n" - "uniform sampler2D texture; \n" + "uniform sampler2D _qt_texture; \n" "uniform lowp vec4 color; \n" "uniform lowp vec4 styleColor; \n" "uniform mediump float alphaMin; \n" @@ -374,7 +374,7 @@ const char *DistanceFieldOutlineTextMaterialShader::fragmentShader() const { "uniform mediump float outlineAlphaMax0; \n" "uniform mediump float outlineAlphaMax1; \n" "void main() { \n" - " mediump float d = texture2D(texture, sampleCoord).a; \n" + " mediump float d = texture2D(_qt_texture, sampleCoord).a; \n" " gl_FragColor = mix(styleColor, color, smoothstep(alphaMin, alphaMax, d)) \n" " * smoothstep(outlineAlphaMax0, outlineAlphaMax1, d); \n" "}"; @@ -514,19 +514,19 @@ const char *DistanceFieldShiftedStyleTextMaterialShader::vertexShader() const const char *DistanceFieldShiftedStyleTextMaterialShader::fragmentShader() const { return - "varying highp vec2 sampleCoord; \n" - "varying highp vec2 shiftedSampleCoord; \n" - "uniform sampler2D texture; \n" - "uniform lowp vec4 color; \n" - "uniform lowp vec4 styleColor; \n" - "uniform mediump float alphaMin; \n" - "uniform mediump float alphaMax; \n" - "void main() { \n" - " highp float a = smoothstep(alphaMin, alphaMax, texture2D(texture, sampleCoord).a);\n" - " highp vec4 shifted = styleColor * smoothstep(alphaMin, \n" - " alphaMax, \n" - " texture2D(texture, shiftedSampleCoord).a); \n" - " gl_FragColor = mix(shifted, color, a); \n" + "varying highp vec2 sampleCoord; \n" + "varying highp vec2 shiftedSampleCoord; \n" + "uniform sampler2D _qt_texture; \n" + "uniform lowp vec4 color; \n" + "uniform lowp vec4 styleColor; \n" + "uniform mediump float alphaMin; \n" + "uniform mediump float alphaMax; \n" + "void main() { \n" + " highp float a = smoothstep(alphaMin, alphaMax, texture2D(_qt_texture, sampleCoord).a); \n" + " highp vec4 shifted = styleColor * smoothstep(alphaMin, \n" + " alphaMax, \n" + " texture2D(_qt_texture, shiftedSampleCoord).a); \n" + " gl_FragColor = mix(shifted, color, a); \n" "}"; } @@ -607,17 +607,17 @@ const char *QSGHiQSubPixelDistanceFieldTextMaterialShader::fragmentShader() cons "varying highp vec3 sampleNearLeft; \n" "varying highp vec3 sampleNearRight; \n" "varying highp vec3 sampleFarRight; \n" - "uniform sampler2D texture; \n" + "uniform sampler2D _qt_texture; \n" "uniform lowp vec4 color; \n" "uniform mediump float alphaMin; \n" "uniform mediump float alphaMax; \n" "void main() { \n" " highp vec4 n; \n" - " n.x = texture2DProj(texture, sampleFarLeft).a; \n" - " n.y = texture2DProj(texture, sampleNearLeft).a; \n" - " highp float c = texture2D(texture, sampleCoord).a; \n" - " n.z = texture2DProj(texture, sampleNearRight).a; \n" - " n.w = texture2DProj(texture, sampleFarRight).a; \n" + " n.x = texture2DProj(_qt_texture, sampleFarLeft).a; \n" + " n.y = texture2DProj(_qt_texture, sampleNearLeft).a; \n" + " highp float c = texture2D(_qt_texture, sampleCoord).a; \n" + " n.z = texture2DProj(_qt_texture, sampleNearRight).a; \n" + " n.w = texture2DProj(_qt_texture, sampleFarRight).a; \n" #if 0 // Blurrier, faster. " n = smoothstep(alphaMin, alphaMax, n); \n" @@ -638,18 +638,18 @@ const char *QSGHiQSubPixelDistanceFieldTextMaterialShader::fragmentShader() cons // return // "#extension GL_OES_standard_derivatives: enable \n" // "varying highp vec2 sampleCoord; \n" -// "uniform sampler2D texture; \n" +// "uniform sampler2D _qt_texture; \n" // "uniform lowp vec4 color; \n" // "uniform highp float alphaMin; \n" // "uniform highp float alphaMax; \n" // "void main() { \n" // " highp vec2 delta = dFdx(sampleCoord); \n" // " highp vec4 n; \n" -// " n.x = texture2D(texture, sampleCoord - 0.667 * delta).a; \n" -// " n.y = texture2D(texture, sampleCoord - 0.333 * delta).a; \n" -// " highp float c = texture2D(texture, sampleCoord).a; \n" -// " n.z = texture2D(texture, sampleCoord + 0.333 * delta).a; \n" -// " n.w = texture2D(texture, sampleCoord + 0.667 * delta).a; \n" +// " n.x = texture2D(_qt_texture, sampleCoord - 0.667 * delta).a; \n" +// " n.y = texture2D(_qt_texture, sampleCoord - 0.333 * delta).a; \n" +// " highp float c = texture2D(_qt_texture, sampleCoord).a; \n" +// " n.z = texture2D(_qt_texture, sampleCoord + 0.333 * delta).a; \n" +// " n.w = texture2D(_qt_texture, sampleCoord + 0.667 * delta).a; \n" // " n = smoothstep(alphaMin, alphaMax, n); \n" // " c = smoothstep(alphaMin, alphaMax, c); \n" // " gl_FragColor = vec4(0.333 * (n.xyz + n.yzw + c), c) * color.w; \n" @@ -746,14 +746,14 @@ const char *QSGLoQSubPixelDistanceFieldTextMaterialShader::fragmentShader() cons return "varying highp vec3 sampleNearLeft; \n" "varying highp vec3 sampleNearRight; \n" - "uniform sampler2D texture; \n" + "uniform sampler2D _qt_texture; \n" "uniform lowp vec4 color; \n" "uniform mediump float alphaMin; \n" "uniform mediump float alphaMax; \n" "void main() { \n" " highp vec2 n; \n" - " n.x = texture2DProj(texture, sampleNearLeft).a; \n" - " n.y = texture2DProj(texture, sampleNearRight).a; \n" + " n.x = texture2DProj(_qt_texture, sampleNearLeft).a; \n" + " n.y = texture2DProj(_qt_texture, sampleNearRight).a; \n" " n = smoothstep(alphaMin, alphaMax, n); \n" " highp float c = 0.5 * (n.x + n.y); \n" " gl_FragColor = vec4(n.x, c, n.y, c) * color.w; \n" |