diff options
author | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-06-03 11:56:13 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-06-03 12:09:22 (GMT) |
commit | 896eb11980b16ba5072dc1e835d40e90eb08c250 (patch) | |
tree | c924ba956f841cb5fb4a4ce97a81f904af34d7be /src/opengl/qgl_x11.cpp | |
parent | 7424f955adc988e79f9158b3683116259a3da0b3 (diff) | |
download | Qt-896eb11980b16ba5072dc1e835d40e90eb08c250.zip Qt-896eb11980b16ba5072dc1e835d40e90eb08c250.tar.gz Qt-896eb11980b16ba5072dc1e835d40e90eb08c250.tar.bz2 |
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
Diffstat (limited to 'src/opengl/qgl_x11.cpp')
-rw-r--r-- | src/opengl/qgl_x11.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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; |