Fixed crash when Image/ShaderEffectSource source is missing.
This commit is contained in:
parent
7ef7dd68dc
commit
acbc84876a
|
@ -179,10 +179,12 @@ QSGTexture *QSGImage::texture() const
|
|||
{
|
||||
Q_D(const QSGImage);
|
||||
QSGTexture *t = d->pix.texture();
|
||||
t->setFiltering(QSGItemPrivate::get(this)->smooth ? QSGTexture::Linear : QSGTexture::Nearest);
|
||||
t->setMipmapFiltering(QSGTexture::None);
|
||||
t->setHorizontalWrapMode(QSGTexture::ClampToEdge);
|
||||
t->setVerticalWrapMode(QSGTexture::ClampToEdge);
|
||||
if (t) {
|
||||
t->setFiltering(QSGItemPrivate::get(this)->smooth ? QSGTexture::Linear : QSGTexture::Nearest);
|
||||
t->setMipmapFiltering(QSGTexture::None);
|
||||
t->setHorizontalWrapMode(QSGTexture::ClampToEdge);
|
||||
t->setVerticalWrapMode(QSGTexture::ClampToEdge);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
|
|
|
@ -206,7 +206,13 @@ void QSGShaderEffectTexture::markDirtyTexture()
|
|||
|
||||
void QSGShaderEffectTexture::grab()
|
||||
{
|
||||
Q_ASSERT(m_item);
|
||||
if (!m_item || m_size.isNull()) {
|
||||
delete m_fbo;
|
||||
delete m_secondaryFbo;
|
||||
m_fbo = m_secondaryFbo = 0;
|
||||
m_dirtyTexture = false;
|
||||
return;
|
||||
}
|
||||
QSGNode *root = m_item;
|
||||
while (root->childCount() && root->type() != QSGNode::RootNodeType)
|
||||
root = root->childAtIndex(0);
|
||||
|
|
Loading…
Reference in New Issue