From 96275509fcec8abc8e580aa6c3c53d893885b7a7 Mon Sep 17 00:00:00 2001 From: Cedric Chedaleux Date: Mon, 3 Feb 2014 15:59:23 +0100 Subject: Fix NPOT decoration texture binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Laszlo Agocs --- src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp') diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 3bc1ff2b1..e7a4b5a2b 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 -- cgit v1.2.3