{
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;
}
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);