diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-03-20 15:40:49 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-02 08:29:53 +0200 |
commit | 5eae605a475db96ed16d81101e00e736efe9f202 (patch) | |
tree | 835210db06b49d48637d192b1064a0e900a57aba /src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp | |
parent | 1c85dc38fa1939d1ce667693a227ab925f6a1dcc (diff) |
Fix distance field antialiasing for retina displays.
Change-Id: I01d7d41a4e70822555bae453978dbe92fbb5c98d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp index d3a8614b11..d409cea81a 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp @@ -43,6 +43,8 @@ #include <QtQuick/private/qsgdistancefieldutil_p.h> #include <QtQuick/private/qsgtexture_p.h> #include <QtGui/qopenglfunctions.h> +#include <QtGui/qsurface.h> +#include <QtGui/qwindow.h> #include <qmath.h> QT_BEGIN_NAMESPACE @@ -115,7 +117,6 @@ void QSGDistanceFieldTextMaterialShader::updateAlphaRange(ThresholdFunc threshol float combinedScale = m_fontScale * m_matrixScale; float base = thresholdFunc(combinedScale); float range = spreadFunc(combinedScale); - float alphaMin = qMax(0.0f, base - range); float alphaMax = qMin(base + range, 1.0f); program()->setUniformValue(m_alphaMin_id, GLfloat(alphaMin)); @@ -157,7 +158,7 @@ void QSGDistanceFieldTextMaterialShader::updateState(const RenderState &state, Q } if (state.isMatrixDirty()) { program()->setUniformValue(m_matrix_id, state.combinedMatrix()); - m_matrixScale = qSqrt(qAbs(state.determinant())); + m_matrixScale = qSqrt(qAbs(state.determinant())) * state.devicePixelRatio(); updateRange = true; } if (updateRange) { |