From: Michael Brasser Date: Sat, 8 Dec 2012 05:05:48 +0000 (-0600) Subject: Work towards supporting front-to-back reordering of opaque items. X-Git-Tag: upstream/5.2.1~812^2~136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b570d384c0704ea12364e353493eeb6f1ae34cd3;p=platform%2Fupstream%2Fqtdeclarative.git Work towards supporting front-to-back reordering of opaque items. Change-Id: Ic3b9defa6ac61409adcfb2b5cb8167698ed00255 Reviewed-by: Gunnar Sletta --- diff --git a/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp b/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp index 8556459..86f43a5 100644 --- a/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp @@ -69,7 +69,7 @@ static bool nodeLessThan(QSGNode *nodeA, QSGNode *nodeB) if (nodeA->type() != QSGNode::GeometryNodeType) return nodeA < nodeB; QSGGeometryNode *a = static_cast(nodeA); - QSGGeometryNode *b = static_cast(nodeA); + QSGGeometryNode *b = static_cast(nodeB); // Sort by clip... if (a->clipList() != b->clipList()) @@ -97,7 +97,7 @@ static bool nodeLessThanWithRenderOrder(QSGNode *nodeA, QSGNode *nodeB) if (nodeA->type() != QSGNode::GeometryNodeType) return nodeA < nodeB; QSGGeometryNode *a = static_cast(nodeA); - QSGGeometryNode *b = static_cast(nodeA); + QSGGeometryNode *b = static_cast(nodeB); // Sort by clip... if (a->clipList() != b->clipList()) diff --git a/src/quick/scenegraph/qsgdefaultimagenode.cpp b/src/quick/scenegraph/qsgdefaultimagenode.cpp index d9c04e1..da2dfcd 100644 --- a/src/quick/scenegraph/qsgdefaultimagenode.cpp +++ b/src/quick/scenegraph/qsgdefaultimagenode.cpp @@ -305,8 +305,8 @@ void QSGDefaultImageNode::setTexture(QSGTexture *texture) 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... @@ -355,12 +355,11 @@ void QSGDefaultImageNode::preprocess() 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);