Udate mipmaps when QSGPaintedItem's texture has changed.

This commit is contained in:
Yoann Lopes 2011-05-09 17:16:16 +02:00
parent 7b7f5671c8
commit 2002baaf68
1 changed files with 9 additions and 0 deletions

View File

@ -89,6 +89,12 @@ void QSGPainterTexture::bind()
GL_BGRA, GL_UNSIGNED_BYTE, subImage.constBits());
#endif
if (m_has_mipmaps && !m_mipmaps_generated) {
const QGLContext *ctx = QGLContext::currentContext();
ctx->functions()->glGenerateMipmap(GL_TEXTURE_2D);
m_mipmaps_generated = true;
}
m_dirty_texture = false;
m_dirty_bind_options = false;
}
@ -337,6 +343,9 @@ void QSGPainterNode::setDirty(bool d, const QRect &dirtyRect)
m_dirtyContents = d;
m_dirtyRect = dirtyRect;
if (m_mipmapping)
m_dirtyTexture = true;
markDirty(DirtyMaterial);
}