summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-05-28 05:30:01 +0000
committerAdam Jackson <ajax@redhat.com>2015-06-16 11:21:26 -0400
commit8a5fb096d43577a061f7769d9257cbedaac998ef (patch)
tree16a7f31e18e58bdc6a28e5abcd5a5926d1e98610
parentea9e02184399e9979654544dde8926912a8aa2c8 (diff)
glamor: don't do render ops with matching source/dest (v2)
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. v2: bump this up a level, and check it earlier. (I assume the XXXX was for this case.) [This corresponds to fa12f2c150b2f50de9dac4a2b09265f13af353af in master, fixed up for 1.17 branch. - ajax] Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--glamor/glamor_largepixmap.c9
-rw-r--r--glamor/glamor_render.c10
2 files changed, 18 insertions, 1 deletions
diff --git a/glamor/glamor_largepixmap.c b/glamor/glamor_largepixmap.c
index 9b2458453..b9c3b9af1 100644
--- a/glamor/glamor_largepixmap.c
+++ b/glamor/glamor_largepixmap.c
@@ -1046,6 +1046,15 @@ glamor_composite_largepixmap_region(CARD8 op,
int source_repeat_type = 0, mask_repeat_type = 0;
int ok = TRUE;
+ if (source_pixmap_priv == dest_pixmap_priv) {
+ glamor_fallback("source and dest pixmaps are the same\n");
+ return FALSE;
+ }
+ if (mask_pixmap_priv == dest_pixmap_priv) {
+ glamor_fallback("mask and dest pixmaps are the same\n");
+ return FALSE;
+ }
+
if (source->repeat)
source_repeat_type = source->repeatType;
else
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 2386f2e2e..d9b16ea05 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1400,6 +1400,7 @@ glamor_composite_clipped_region(CARD8 op,
{
ScreenPtr screen = dest->pDrawable->pScreen;
PixmapPtr source_pixmap = NULL, mask_pixmap = NULL;
+ PixmapPtr dest_pixmap = glamor_get_drawable_pixmap(dest->pDrawable);
PicturePtr temp_src = source, temp_mask = mask;
glamor_pixmap_private *temp_src_priv = source_pixmap_priv;
glamor_pixmap_private *temp_mask_priv = mask_pixmap_priv;
@@ -1502,7 +1503,14 @@ glamor_composite_clipped_region(CARD8 op,
}
}
- /*XXXXX, self copy? */
+ if (source_pixmap == dest_pixmap) {
+ glamor_fallback("source and dest pixmaps are the same\n");
+ goto out;
+ }
+ if (mask_pixmap == dest_pixmap) {
+ glamor_fallback("mask and dest pixmaps are the same\n");
+ goto out;
+ }
x_dest += dest->pDrawable->x;
y_dest += dest->pDrawable->y;