aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-11-11 08:30:43 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-11 09:48:08 +0100
commit98c47db70a72a8afbd86afd355dadb1ce9113361 (patch)
tree1c4181669788024fc228bd88f6531b1ce4b346f6 /src
parentb31d47e5b87f92178ced4adc15984d9960e9e01c (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.cpp7
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h1
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; }