Include the textureid/glyph cache in the material sorting
authorGunnar Sletta <gunnar.sletta@nokia.com>
Fri, 30 Sep 2011 13:46:17 +0000 (15:46 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 30 Sep 2011 14:50:17 +0000 (16:50 +0200)
Change-Id: Ic9740081e9e0e53801bbda64f6b147ab74102663
Reviewed-on: http://codereview.qt-project.org/5887
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
src/declarative/scenegraph/qsgdistancefieldglyphnode_p.cpp

index 72c53a2..1e8b668 100644 (file)
@@ -225,6 +225,8 @@ int QSGDistanceFieldTextMaterial::compare(const QSGMaterial *o) const
 {
     Q_ASSERT(o && type() == o->type());
     const QSGDistanceFieldTextMaterial *other = static_cast<const QSGDistanceFieldTextMaterial *>(o);
+    if (m_glyph_cache != other->m_glyph_cache)
+        return m_glyph_cache - other->m_glyph_cache;
     if (m_glyph_cache->fontScale() != other->m_glyph_cache->fontScale()) {
         qreal s1 = m_glyph_cache->fontScale();
         qreal s2 = other->m_glyph_cache->fontScale();