if (nodeA->type() != QSGNode::GeometryNodeType)
return nodeA < nodeB;
QSGGeometryNode *a = static_cast<QSGGeometryNode *>(nodeA);
- QSGGeometryNode *b = static_cast<QSGGeometryNode *>(nodeA);
+ QSGGeometryNode *b = static_cast<QSGGeometryNode *>(nodeB);
// Sort by clip...
if (a->clipList() != b->clipList())
if (nodeA->type() != QSGNode::GeometryNodeType)
return nodeA < nodeB;
QSGGeometryNode *a = static_cast<QSGGeometryNode *>(nodeA);
- QSGGeometryNode *b = static_cast<QSGGeometryNode *>(nodeA);
+ QSGGeometryNode *b = static_cast<QSGGeometryNode *>(nodeB);
// Sort by clip...
if (a->clipList() != b->clipList())
m_materialO.setTexture(texture);
m_smoothMaterial.setTexture(texture);
// Texture cleanup
-// if (!texture.isNull())
-// m_material.setBlending(texture->hasAlphaChannel());
+ if (texture)
+ m_material.setFlag(QSGMaterial::Blending, texture->hasAlphaChannel());
markDirty(DirtyMaterial);
// Because the texture can be a different part of the atlas, we need to update it...
doDirty = t->updateTexture();
updateGeometry();
}
-// ### texture cleanup
-// bool alpha = m_material.blending();
-// if (!m_material->texture().isNull() && alpha != m_material.texture()->hasAlphaChannel()) {
-// m_material.setBlending(!alpha);
-// doDirty = true;
-// }
+ bool alpha = m_material.flags() & QSGMaterial::Blending;
+ if (m_material.texture() && alpha != m_material.texture()->hasAlphaChannel()) {
+ m_material.setFlag(QSGMaterial::Blending, !alpha);
+ doDirty = true;
+ }
if (doDirty)
markDirty(DirtyMaterial);