// THIS METHOD IS EXECUTED IN THE RENDERING THREAD void QmlAsTexture::textureChanged() { if (!this->effectItem) return ; QSGDynamicTexture *txt = dynamic_cast<QSGDynamicTexture*>(this->provider->texture()); if (txt) { qDebug() << "Texture Id " << txt->textureId() << " SIZE " << txt->textureSize(); this->effectItem->setDynamicTexture(txt->textureId(), txt->textureSize()); } }
void QSGDefaultImageNode::preprocess() { bool doDirty = false; QSGDynamicTexture *t = qobject_cast<QSGDynamicTexture *>(m_material.texture()); if (t) { doDirty = t->updateTexture(); updateGeometry(); } 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); }
void QSGBasicInternalImageNode::preprocess() { bool doDirty = false; QSGDynamicTexture *t = qobject_cast<QSGDynamicTexture *>(materialTexture()); if (t) { doDirty = t->updateTexture(); if (doDirty) { // The geometry may need updating. This is expensive however, so do // it only when something relevant has changed. if (t != m_dynamicTexture || t->textureSize() != m_dynamicTextureSize || t->normalizedTextureSubRect() != m_dynamicTextureSubRect) { updateGeometry(); m_dynamicTextureSize = t->textureSize(); m_dynamicTextureSubRect = t->normalizedTextureSubRect(); } } } m_dynamicTexture = t; if (updateMaterialBlending()) doDirty = true; if (doDirty) markDirty(DirtyMaterial); }