summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-03-18 13:27:47 -0400
committerJasper St. Pierre <jstpierre@mecheye.net>2013-03-18 15:23:19 -0400
commite216b6ca0fd968e42b612f0a0508f798756d0890 (patch)
tree5f401a0e210fa9220450525355bff93f50d2af2b
parent8a33880c00cd994e70bdbe5198e712408a3d175e (diff)
downloadmutter-e216b6ca0fd968e42b612f0a0508f798756d0890.tar.gz
background: Fix the desaturate effect when on its own
We need to make sure cogl_texel is set to something, otherwise we'll have junk. https://bugzilla.gnome.org/show_bug.cgi?id=696087
-rw-r--r--src/compositor/meta-background.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index fd2d1d271..7876d594c 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -63,6 +63,11 @@
" return vec3(mix(color.rgb, gray, 1.0 - saturation));\n" \
"}\n" \
+/* Used when we don't have a blur, as the texel is going to be junk
+ * unless we set something to it. */
+#define DESATURATE_PRELUDE \
+"cogl_texel = texture2D(cogl_sampler, cogl_tex_coord.st);\n"
+
#define DESATURATE_CODE \
"cogl_texel.rgb = desaturate(cogl_texel.rgb);\n"
@@ -621,7 +626,7 @@ add_texture_lookup_shader (MetaBackground *self)
else if (priv->effects & META_BACKGROUND_EFFECTS_BLUR)
code = BLUR_CODE;
else if (priv->effects & META_BACKGROUND_EFFECTS_DESATURATE)
- code = DESATURATE_CODE;
+ code = DESATURATE_PRELUDE "\n" DESATURATE_CODE;
else
return;