[clutter/fosdem-2012] wayland-surface: Add workaround to ignore alpha channel



commit 448af847f02a9aef143ac52abb795765149df679
Author: Robert Bragg <robert linux intel com>
Date:   Tue Jan 10 17:07:45 2012 +0000

    wayland-surface: Add workaround to ignore alpha channel
    
    This adds a workaround that forces a texture combine mode that ignores
    the alpha component of textures created from wayland buffers. We need
    this because wayland currently lacks a way to inform the compositor if
    the alpha channel is valid or junk and in cases where it's junk we
    otherwise get blending artefacts.

 clutter/wayland/clutter-wayland-surface.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/clutter/wayland/clutter-wayland-surface.c b/clutter/wayland/clutter-wayland-surface.c
index 639cf5a..6a82680 100644
--- a/clutter/wayland/clutter-wayland-surface.c
+++ b/clutter/wayland/clutter-wayland-surface.c
@@ -321,6 +321,16 @@ clutter_wayland_surface_paint (ClutterActor *self)
                                   paint_opacity,
                                   paint_opacity,
                                   paint_opacity);
+
+      /* XXX: Currently wayland doesn't have a way to inform the compositor
+       * whether a buffer has a valid alpha component or not so we have
+       * to forcibly override the alpha component in case it contains junk.
+       */
+      cogl_material_set_layer_combine (priv->pipeline, 0,
+                                       "RGB = MODULATE (TEXTURE, PREVIOUS)"
+                                       "A = REPLACE (PREVIOUS)",
+                                       NULL);
+
       cogl_pipeline_set_layer_texture (priv->pipeline, 0,
                                        COGL_TEXTURE (priv->buffer));
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]