diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2011-05-09 17:16:16 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2011-05-09 17:16:54 +0200 |
commit | 2002baaf680a4dd4637bd400161e29e0c0a0dc47 (patch) | |
tree | db88b67befe48e714b227cb1dfb8c5f5ba586581 /src | |
parent | 7b7f5671c8dbcdbedc9fe60ab8eb0f01df8ddf6a (diff) |
Udate mipmaps when QSGPaintedItem's texture has changed.
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/scenegraph/util/qsgpainternode.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/scenegraph/util/qsgpainternode.cpp b/src/declarative/scenegraph/util/qsgpainternode.cpp index ee42a3851f..d3dae11202 100644 --- a/src/declarative/scenegraph/util/qsgpainternode.cpp +++ b/src/declarative/scenegraph/util/qsgpainternode.cpp @@ -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); } |