From 2002baaf680a4dd4637bd400161e29e0c0a0dc47 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 9 May 2011 17:16:16 +0200 Subject: [PATCH] Udate mipmaps when QSGPaintedItem's texture has changed. --- 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 ee42a38..d3dae11 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); } -- 1.7.2.5