Fix sorting of QSGTextMaskMaterial (native glyph drawing).
authorGunnar Sletta <gunnar.sletta@digia.com>
Mon, 13 May 2013 14:02:30 +0000 (16:02 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 14 May 2013 20:22:28 +0000 (22:22 +0200)
It seems we were hitting the bool operator rather than the
pointer values so all text materials, regardless of size
or style would return equal.

Change-Id: I8773e5aa965035f6737920747c2cf073929ff799
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
src/quick/scenegraph/qsgdefaultglyphnode_p.cpp

index 3df1153..f5a461f 100644 (file)
@@ -521,7 +521,7 @@ int QSGTextMaskMaterial::compare(const QSGMaterial *o) const
     Q_ASSERT(o && type() == o->type());
     const QSGTextMaskMaterial *other = static_cast<const QSGTextMaskMaterial *>(o);
     if (m_glyphCache != other->m_glyphCache)
-        return m_glyphCache - other->m_glyphCache;
+        return m_glyphCache.data() < other->m_glyphCache.data() ? -1 : 1;
     QRgb c1 = m_color.rgba();
     QRgb c2 = other->m_color.rgba();
     return int(c2 < c1) - int(c1 < c2);