Implement missing compare() function for Raised/Sunken text
authorGunnar Sletta <gunnar.sletta@digia.com>
Mon, 11 Nov 2013 07:30:43 +0000 (08:30 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 11 Nov 2013 08:48:08 +0000 (09:48 +0100)
Task-number: QTBUG-34715

Change-Id: Ifdac2511b7f642b1ea4bd06847c840b5a951a753
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h

index ac936b6..12a4312 100644 (file)
@@ -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
 {
index cf0d2d5..d56fd01 100644 (file)
@@ -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; }