[clutter/wip/wayland: 19/45] wayland-surface: Add workaround to ignore alpha channel
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/wayland: 19/45] wayland-surface: Add workaround to ignore alpha channel
- Date: Wed, 22 Feb 2012 18:01:18 +0000 (UTC)
commit 51e6ff10793e3d26fb9e3b0dd0a5366aa6d4f6b8
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 c368c1e..08ff666 100644
--- a/clutter/wayland/clutter-wayland-surface.c
+++ b/clutter/wayland/clutter-wayland-surface.c
@@ -323,6 +323,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]