On GLES 2, GL_REPEAT makes the whole texture sampling fail, resulting
in black instead of the wallpaper. According to GLES 2 spec, the only
working wrapping mode for NPOT textures is GL_CLAMP_TO_EDGE.

Wallpaper setters (well, Esetroot) apparently set a root window
background pixmap that is full size, repeated if needed. Almost always
this means it is NPOT.

This patch lets Esetroot wallpapers and compiz --bg-image NPOT
wallpapers to show up. For non-square background or image the aspect
ratio is still wrong.

Background set via --bg-image is not repeated to cover the whole
screen. The non-covered portion will show window trails. This behaviour
existed also before this patch, as PrivateGLScreen::paintBackground ()
does not support painting regions larger than the texture list's region.

Signed-off-by: Pekka Paalanen <[email protected]>
---
 plugins/opengl/src/screen.cpp |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/plugins/opengl/src/screen.cpp b/plugins/opengl/src/screen.cpp
index e6fbe8b..af27693 100644
--- a/plugins/opengl/src/screen.cpp
+++ b/plugins/opengl/src/screen.cpp
@@ -1116,18 +1116,6 @@ PrivateGLScreen::updateScreenBackground ()
 
        backgroundTextures = GLTexture::readImageToTexture (fileName, pname, 
size);
     }
-
-    if (!backgroundTextures.empty ())
-    {
-       foreach (GLTexture *t, backgroundTextures)
-           if (t->target () == GL_TEXTURE_2D)
-           {
-               glBindTexture (t->target (), t->name ());
-               glTexParameteri (t->target (), GL_TEXTURE_WRAP_S, GL_REPEAT);
-               glTexParameteri (t->target (), GL_TEXTURE_WRAP_T, GL_REPEAT);
-               glBindTexture (t->target (), 0);
-           }
-    }
 }
 
 void
-- 
1.7.3.4

_______________________________________________
dev mailing list
[email protected]
http://lists.compiz.org/mailman/listinfo/dev

Reply via email to