diff options
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); |