diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-11-10 22:42:29 +0200 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-11-10 22:42:29 +0200 |
commit | f5701f0def37fcc0c2b38ae9552eb3a896a34687 (patch) | |
tree | aa9a7ebb39bedb6794f199d94525f5ddfb696308 /src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | |
parent | da0aac1057552048f59075beb31861a6cc076684 (diff) | |
parent | e24effdceb3a504182ae271200408750991aa94a (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
Change-Id: I2e0f34eea87c1393dff82f153650eccf5048248f
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultglyphnode_p.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 0fd6581dc4..f912da5799 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -119,7 +119,8 @@ public: protected: void initialize() override; - int m_matrix_id; + int m_projectionMatrix_id; + int m_modelViewMatrix_id; int m_color_id; int m_textureScale_id; float m_devicePixelRatio; @@ -135,7 +136,8 @@ char const *const *QSGTextMaskShader::attributeNames() const QSGTextMaskShader::QSGTextMaskShader(QFontEngine::GlyphFormat glyphFormat) : QSGMaterialShader(*new QSGMaterialShaderPrivate) - , m_matrix_id(-1) + , m_projectionMatrix_id(-1) + , m_modelViewMatrix_id(-1) , m_color_id(-1) , m_textureScale_id(-1) , m_glyphFormat(glyphFormat) @@ -146,7 +148,8 @@ QSGTextMaskShader::QSGTextMaskShader(QFontEngine::GlyphFormat glyphFormat) void QSGTextMaskShader::initialize() { - m_matrix_id = program()->uniformLocation("matrix"); + m_projectionMatrix_id = program()->uniformLocation("projectionMatrix"); + m_modelViewMatrix_id = program()->uniformLocation("modelViewMatrix"); m_color_id = program()->uniformLocation("color"); m_textureScale_id = program()->uniformLocation("textureScale"); m_devicePixelRatio = (float) qsg_device_pixel_ratio(QOpenGLContext::currentContext()); @@ -184,8 +187,10 @@ void QSGTextMaskShader::updateState(const RenderState &state, QSGMaterial *newEf program()->setUniformValue("dpr", m_devicePixelRatio); } - if (state.isMatrixDirty()) - program()->setUniformValue(m_matrix_id, state.combinedMatrix()); + if (state.isMatrixDirty()) { + program()->setUniformValue(m_projectionMatrix_id, state.projectionMatrix()); + program()->setUniformValue(m_modelViewMatrix_id, state.modelViewMatrix()); + } } class QSG8BitTextMaskShader : public QSGTextMaskShader @@ -387,8 +392,10 @@ void QSGStyledTextShader::updateState(const RenderState &state, } } - if (state.isMatrixDirty()) - program()->setUniformValue(m_matrix_id, state.combinedMatrix()); + if (state.isMatrixDirty()) { + program()->setUniformValue(m_projectionMatrix_id, state.projectionMatrix()); + program()->setUniformValue(m_modelViewMatrix_id, state.modelViewMatrix()); + } } class QSGOutlinedTextShader : public QSGStyledTextShader |