From 896eb11980b16ba5072dc1e835d40e90eb08c250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Thu, 3 Jun 2010 13:56:13 +0200 Subject: Fix the bindTexture() filters on X11 to not rely on mipmap generation. The default GL_TEXTURE_MIN_FILTER is GL_NEAREST_MIPMAP_LINEAR, which means you have to have mipmaps generated in order for it to produce correct results. We don't use mipmaps when this particular path is taken, so use texture filters that is in line with what we do in the non-pixmap_to_texture path. Task-number: QTBUG-11158 Reviewed-by: Kim --- src/opengl/qgl_x11.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp index f0b06ef5..326785e 100644 --- a/src/opengl/qgl_x11.cpp +++ b/src/opengl/qgl_x11.cpp @@ -1765,6 +1765,9 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, con glXBindTexImageEXT(x11Info.display(), (GLXPixmap)pixmapData->gl_surface, GLX_FRONT_LEFT_EXT, 0); glBindTexture(GL_TEXTURE_2D, textureId); + GLuint filtering = (options & QGLContext::LinearFilteringBindOption) ? GL_LINEAR : GL_NEAREST; + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering); if (!((hasAlpha && RGBAConfigInverted) || (!hasAlpha && RGBConfigInverted))) options &= ~QGLContext::InvertedYBindOption; -- cgit v0.12