[PATCH] glamor: don't do render ops with matching source/dest

Dave Airlie airlied at gmail.com
Wed May 27 22:31:24 PDT 2015


From: Dave Airlie <airlied at redhat.com>

XRender defines this, GL really doesn't like it.

kwin 4.x and qt 4.x seem to make this happen for the
gradient in the titlebar, and on radeonsi/r600 hw
this draws all kinds of wrong.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 glamor/glamor_render.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index efca367..b3046b4 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1149,6 +1149,14 @@ glamor_composite_with_shader(CARD8 op,
     glamor_composite_shader *shader = NULL, *shader_ca = NULL;
     struct blendinfo op_info, op_info_ca;
 
+    if (source_pixmap == dest_pixmap) {
+        glamor_fallback("source and dest pixmaps are the same\n");
+        return ret;
+    }
+    if (mask_pixmap == dest_pixmap) {
+        glamor_fallback("mask and dest pixmaps are the same\n");
+        return ret;
+    }
     if (!glamor_composite_choose_shader(op, source, mask, dest,
                                         source_pixmap, mask_pixmap, dest_pixmap,
                                         source_pixmap_priv, mask_pixmap_priv,
-- 
1.8.3.1



More information about the xorg-devel mailing list