diff options
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/scenegraph/shaders/outlinedtext.vert | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders/outlinedtext_core.vert | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders/styledtext.vert | 3 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders/styledtext_core.vert | 3 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders/textmask.vert | 3 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders/textmask_core.vert | 3 |
6 files changed, 14 insertions, 6 deletions
diff --git a/src/quick/scenegraph/shaders/outlinedtext.vert b/src/quick/scenegraph/shaders/outlinedtext.vert index ced8afd034..9df832de3c 100644 --- a/src/quick/scenegraph/shaders/outlinedtext.vert +++ b/src/quick/scenegraph/shaders/outlinedtext.vert @@ -1,6 +1,7 @@ uniform highp mat4 matrix; uniform highp vec2 textureScale; uniform highp vec2 shift; +uniform highp float dpr; attribute highp vec4 vCoord; attribute highp vec2 tCoord; @@ -18,5 +19,6 @@ void main() sCoordDown = (tCoord - vec2(0.0, 1.0)) * textureScale; sCoordLeft = (tCoord - vec2(-1.0, 0.0)) * textureScale; sCoordRight = (tCoord - vec2(1.0, 0.0)) * textureScale; - gl_Position = matrix * vCoord; + vec3 dprSnapPos = floor(vCoord.xyz * dpr + 0.5) / dpr; + gl_Position = matrix * vec4(dprSnapPos, vCoord.w); }
\ No newline at end of file diff --git a/src/quick/scenegraph/shaders/outlinedtext_core.vert b/src/quick/scenegraph/shaders/outlinedtext_core.vert index 4aa13101fd..ae945b013a 100644 --- a/src/quick/scenegraph/shaders/outlinedtext_core.vert +++ b/src/quick/scenegraph/shaders/outlinedtext_core.vert @@ -12,6 +12,7 @@ out vec2 sCoordRight; uniform mat4 matrix; uniform vec2 textureScale; uniform vec2 shift; +uniform float dpr; void main() { @@ -20,5 +21,6 @@ void main() sCoordDown = (tCoord - vec2(0.0, 1.0)) * textureScale; sCoordLeft = (tCoord - vec2(-1.0, 0.0)) * textureScale; sCoordRight = (tCoord - vec2(1.0, 0.0)) * textureScale; - gl_Position = matrix * vCoord; + vec3 dprSnapPos = round(vCoord.xyz * dpr + 0.5) / dpr; + gl_Position = matrix * vec4(dprSnapPos, vCoord.w); }
\ No newline at end of file diff --git a/src/quick/scenegraph/shaders/styledtext.vert b/src/quick/scenegraph/shaders/styledtext.vert index 7001bbc262..29c9902609 100644 --- a/src/quick/scenegraph/shaders/styledtext.vert +++ b/src/quick/scenegraph/shaders/styledtext.vert @@ -13,5 +13,6 @@ void main() { sampleCoord = tCoord * textureScale; shiftedSampleCoord = (tCoord - shift) * textureScale; - gl_Position = matrix * floor(vCoord * dpr + 0.5) / dpr; + vec3 dprSnapPos = floor(vCoord.xyz * dpr + 0.5) / dpr; + gl_Position = matrix * vec4(dprSnapPos, vCoord.w); } diff --git a/src/quick/scenegraph/shaders/styledtext_core.vert b/src/quick/scenegraph/shaders/styledtext_core.vert index c522877bb3..7e313eb797 100644 --- a/src/quick/scenegraph/shaders/styledtext_core.vert +++ b/src/quick/scenegraph/shaders/styledtext_core.vert @@ -15,5 +15,6 @@ void main() { sampleCoord = tCoord * textureScale; shiftedSampleCoord = (tCoord - shift) * textureScale; - gl_Position = matrix * round(vCoord * dpr) / dpr; + vec3 dprSnapPos = round(vCoord.xyz * dpr + 0.5) / dpr; + gl_Position = matrix * vec4(dprSnapPos, vCoord.w); } diff --git a/src/quick/scenegraph/shaders/textmask.vert b/src/quick/scenegraph/shaders/textmask.vert index 4c678270d0..1692159d2c 100644 --- a/src/quick/scenegraph/shaders/textmask.vert +++ b/src/quick/scenegraph/shaders/textmask.vert @@ -10,5 +10,6 @@ varying highp vec2 sampleCoord; void main() { sampleCoord = tCoord * textureScale; - gl_Position = matrix * floor(vCoord * dpr + 0.5) / dpr; + vec3 dprSnapPos = floor(vCoord.xyz * dpr + 0.5) / dpr; + gl_Position = matrix * vec4(dprSnapPos, vCoord.w); } diff --git a/src/quick/scenegraph/shaders/textmask_core.vert b/src/quick/scenegraph/shaders/textmask_core.vert index f996040f70..5c510a2d23 100644 --- a/src/quick/scenegraph/shaders/textmask_core.vert +++ b/src/quick/scenegraph/shaders/textmask_core.vert @@ -12,5 +12,6 @@ uniform float dpr; void main() { sampleCoord = tCoord * textureScale; - gl_Position = matrix * round(vCoord * dpr) / dpr; + vec3 dprSnapPos = round(vCoord.xyz * dpr + 0.5) / dpr; + gl_Position = matrix * vec4(dprSnapPos, vCoord.w); } |