aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders_ng/textmask.frag
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-10-12 13:13:01 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-13 21:23:29 +0000
commit4757cac470edbeaeaceca4e63075d9f1139f546b (patch)
tree68084b9d01367771b8e002058208065a2404af70 /src/quick/scenegraph/shaders_ng/textmask.frag
parent9a9df880cf78580c35f9ec31b3f522c4fe045e9f (diff)
Fix distorted text with subpixel matrix translation
We would pixel-align native text *before* applying the model-view matrix, which would cause GL_NEAREST artifacts to show up when the text was positioned at a subpixel offset in some cases. Instead, we pixel-align the coordinates after mapping them to the view frustum, but before applying the projection to the screen. To make it easier to modify the buffer layout for the shaders the next time, this also adds some constants for offsets. [ChangeLog][Text] Fixed an issue where text using NativeRendering would look slightly skewed if it was inside a parent that had been positioned at a subpixel offset. Fixes: QTBUG-96112 Fixes: QTBUG-83626 Task-number: QTBUG-55638 Change-Id: Ifb785ad5830093df94afc75a7bc288e24ca7aa38 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit b21948f5e811ce1b7abf065bc48af61a231e86f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/scenegraph/shaders_ng/textmask.frag')
-rw-r--r--src/quick/scenegraph/shaders_ng/textmask.frag3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/shaders_ng/textmask.frag b/src/quick/scenegraph/shaders_ng/textmask.frag
index 518d5c965f..ed8da4cd30 100644
--- a/src/quick/scenegraph/shaders_ng/textmask.frag
+++ b/src/quick/scenegraph/shaders_ng/textmask.frag
@@ -6,7 +6,8 @@ layout(location = 0) out vec4 fragColor;
layout(binding = 1) uniform sampler2D _qt_texture;
layout(std140, binding = 0) uniform buf {
- mat4 matrix;
+ mat4 modelViewMatrix;
+ mat4 projectionMatrix;
vec4 color;
vec2 textureScale;
float dpr;