Skip to content

Commit

Permalink
Udate mipmaps when QSGPaintedItem's texture has changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoann Lopes committed May 9, 2011
1 parent 7b7f567 commit 2002baa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/declarative/scenegraph/util/qsgpainternode.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 2002baa

Please sign in to comment.