summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-06-10 08:52:31 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2009-06-13 10:20:19 -0400
commitebc39ed35a9f79ac9bb329bfc7dc27f290f6e1b0 (patch)
treebea2736918d880e19913f93f16f14a5c8fafb3d5
parent08eb065c568de5c0cb67b7b02ccb17bf72d5059c (diff)
Work around X server bug.
X servers prior to ebfd6688d1927288155221e7a78fbca9f9293952 relied on pixman not clipping to destination geometry whenever an explicit clip region was set. Since only X servers set source_clipping, we can just trigger off of that.
-rw-r--r--TODO2
-rw-r--r--pixman/pixman-compute-region.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/TODO b/TODO
index 6abeb0b0..52d73770 100644
--- a/TODO
+++ b/TODO
@@ -14,6 +14,8 @@
the required precision by simply adding offset_x/y to the
relevant rendering API?
+ - Get rid of workaround for X server bug.
+
- pixman_image_set_indexed() should copy its argument, and X
should be ported over to use a pixman_image as the
representation of a Picture, rather than creating one on each
diff --git a/pixman/pixman-compute-region.c b/pixman/pixman-compute-region.c
index 70ffa3fe..72fd9e84 100644
--- a/pixman/pixman-compute-region.c
+++ b/pixman/pixman-compute-region.c
@@ -136,8 +136,17 @@ pixman_compute_composite_region32 (pixman_region32_t * pRegion,
pRegion->extents.x1 = MAX (pRegion->extents.x1, 0);
pRegion->extents.y1 = MAX (pRegion->extents.y1, 0);
- pRegion->extents.x2 = MIN (pRegion->extents.x2, pDst->bits.width);
- pRegion->extents.y2 = MIN (pRegion->extents.y2, pDst->bits.height);
+
+ /* Some X servers rely on an old bug, where pixman would just believe the
+ * set clip_region and not clip against the destination geometry. So,
+ * since only X servers set "source clip", we only clip against destination
+ * geometry when that is set.
+ */
+ if (!pDst->common.clip_sources)
+ {
+ pRegion->extents.x2 = MIN (pRegion->extents.x2, pDst->bits.width);
+ pRegion->extents.y2 = MIN (pRegion->extents.y2, pDst->bits.height);
+ }
pRegion->data = 0;