diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-11-11 08:30:43 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-11 09:48:08 +0100 |
commit | 98c47db70a72a8afbd86afd355dadb1ce9113361 (patch) | |
tree | 1c4181669788024fc228bd88f6531b1ce4b346f6 /src | |
parent | b31d47e5b87f92178ced4adc15984d9960e9e01c (diff) |
Implement missing compare() function for Raised/Sunken text
Task-number: QTBUG-34715
Change-Id: Ifdac2511b7f642b1ea4bd06847c840b5a951a753
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp index ac936b6663..12a431246c 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp @@ -471,6 +471,13 @@ QSGMaterialShader *QSGDistanceFieldShiftedStyleTextMaterial::createShader() cons return new DistanceFieldShiftedStyleTextMaterialShader; } +int QSGDistanceFieldShiftedStyleTextMaterial::compare(const QSGMaterial *o) const +{ + const QSGDistanceFieldShiftedStyleTextMaterial *other = static_cast<const QSGDistanceFieldShiftedStyleTextMaterial *>(o); + if (m_shift != other->m_shift) + return &m_shift < &other->m_shift ? -1 : 1; + return QSGDistanceFieldStyledTextMaterial::compare(o); +} class QSGHiQSubPixelDistanceFieldTextMaterialShader : public QSGDistanceFieldTextMaterialShader { diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h index cf0d2d525e..d56fd01d3e 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h @@ -117,6 +117,7 @@ public: virtual QSGMaterialType *type() const; virtual QSGMaterialShader *createShader() const; + virtual int compare(const QSGMaterial *other) const; void setShift(const QPointF &shift) { m_shift = shift; } const QPointF &shift() const { return m_shift; } |