diff options
author | Michael Brasser <michael.brasser@live.com> | 2012-12-07 23:05:48 -0600 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-12 03:54:17 +0100 |
commit | b570d384c0704ea12364e353493eeb6f1ae34cd3 (patch) | |
tree | 4efb719a2553159ceeadbf383fa09e61abcd865b /src/quick/scenegraph/qsgdefaultimagenode.cpp | |
parent | 87d0c02fab03b7d3bf2094af22465f029bcdd096 (diff) |
Work towards supporting front-to-back reordering of opaque items.
Change-Id: Ic3b9defa6ac61409adcfb2b5cb8167698ed00255
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultimagenode.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultimagenode.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/quick/scenegraph/qsgdefaultimagenode.cpp b/src/quick/scenegraph/qsgdefaultimagenode.cpp index d9c04e1959..da2dfcda64 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); |