aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-04-13 09:46:15 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-04-13 09:46:15 +0200
commit4b72f48637a87c95deedcc501cd9cc8f717117fa (patch)
tree80f00ade2cc3f3845e0f309f39a2649040d203e3 /src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
parent3d30c6d7b40ce86f49bc7bdc5c2c74ce180bb3dd (diff)
parentf7e1f7b2f1f1577fd94dfffb93ef15ded5d09031 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/BLACKLIST Change-Id: Ie81612f2884f8ea508c48ba2735ec54ea1c2eca5
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultglyphnode_p.cpp')
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
index ec9106e86b..0c4b2f9af9 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -92,6 +92,7 @@ protected:
int m_matrix_id;
int m_color_id;
int m_textureScale_id;
+ float m_devicePixelRatio;
QFontEngine::GlyphFormat m_glyphFormat;
};
@@ -124,7 +125,8 @@ void QSGTextMaskShader::initialize()
m_matrix_id = program()->uniformLocation("matrix");
m_color_id = program()->uniformLocation("color");
m_textureScale_id = program()->uniformLocation("textureScale");
- program()->setUniformValue("dpr", (float) qsg_device_pixel_ratio(QOpenGLContext::currentContext()));
+ m_devicePixelRatio = (float) qsg_device_pixel_ratio(QOpenGLContext::currentContext());
+ program()->setUniformValue("dpr", m_devicePixelRatio);
}
void QSGTextMaskShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect)
@@ -152,6 +154,12 @@ void QSGTextMaskShader::updateState(const RenderState &state, QSGMaterial *newEf
}
}
+ float devicePixelRatio = (float) qsg_device_pixel_ratio(QOpenGLContext::currentContext());
+ if (m_devicePixelRatio != devicePixelRatio) {
+ m_devicePixelRatio = devicePixelRatio;
+ program()->setUniformValue("dpr", m_devicePixelRatio);
+ }
+
if (state.isMatrixDirty())
program()->setUniformValue(m_matrix_id, state.combinedMatrix());
}