diff options
author | Cedric Chedaleux <cedric.chedaleux@orange.com> | 2014-02-03 15:59:23 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-12 15:23:16 +0100 |
commit | 96275509fcec8abc8e580aa6c3c53d893885b7a7 (patch) | |
tree | 613f1237c93ec7a5c3f9a37b4f33e81a220a9b1e | |
parent | 1f8f991d7c61d046783b3f541d9121f0a47bcd23 (diff) | |
download | qtwayland-96275509fcec8abc8e580aa6c3c53d893885b7a7.tar.gz qtwayland-96275509fcec8abc8e580aa6c3c53d893885b7a7.tar.bz2 qtwayland-96275509fcec8abc8e580aa6c3c53d893885b7a7.zip |
Fix NPOT decoration texture bindingupstream/5.2.90+alpha
If the context does not support the NPOTTextureRepeat (i.e. GL_OES_texture_npot extension), wrapping must be set to CLAMP_TO_EDGE to prevent invalid texture mapping.
Change-Id: I3ededccc14a32188986529c14fa91161fb383cfc
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 3bc1ff2b..e7a4b5a2 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -210,6 +210,10 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface) m_textureCache->bindTexture(context(), decorationImage); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + if (!context()->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat)) { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + } glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); //Draw Content |