summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-10-29 16:52:44 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-10-29 16:55:58 +0000
commit61436c2fabe117b85404eecb06158ba0a63a7741 (patch)
tree173dfc47158db5d338c70e233157dcd0918a5b80
parentd08a5f555a0c47ae23c0f9a890b512cb23e74feb (diff)
sna: Fix build for GC API changes in Xorg-1.16.99.901
The GC struct was changed in commit 73e2383b7350723256894c5076d0c731aec5cd1f Author: Adam Jackson <ajax@redhat.com> Date: Fri Jun 20 13:31:20 2014 -0400 dix: Always store GC client clip as a region (v2) update to match. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85581 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 176a6127..b2fe6d4a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4395,6 +4395,7 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
sgc->priv = gc->pCompositeClip;
gc->pCompositeClip = region;
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
if (gc->clientClipType == CT_PIXMAP) {
PixmapPtr clip = gc->clientClip;
gc->clientClip = region_from_bitmap(gc->pScreen, clip);
@@ -4403,6 +4404,9 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
changes |= GCClipMask;
} else
changes &= ~GCClipMask;
+#else
+ changes &= ~GCClipMask;
+#endif
if (changes || drawable->serialNumber != (sgc->serial & DRAWABLE_SERIAL_BITS)) {
long tmp = gc->serialNumber;
@@ -6862,6 +6866,15 @@ static inline bool box_equal(const BoxRec *a, const BoxRec *b)
return *(const uint64_t *)a == *(const uint64_t *)b;
}
+static inline bool has_clip(GCPtr gc)
+{
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+ return gc->clientClipType != CT_NONE;
+#else
+ return gc->clientClip != NULL;
+#endif
+}
+
static RegionPtr
sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
int sx, int sy,
@@ -6948,7 +6961,7 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc,
/* Compute source clip region */
if (src->type == DRAWABLE_PIXMAP) {
- if (src == dst && gc->clientClipType == CT_NONE) {
+ if (src == dst && !has_clip(gc)) {
DBG(("%s: pixmap -- using gc clip\n", __FUNCTION__));
clip = gc->pCompositeClip;
} else {
@@ -16622,7 +16635,7 @@ sna_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
if (changes & (GCClipMask|GCSubwindowMode) ||
drawable->serialNumber != (gc->serialNumber & DRAWABLE_SERIAL_BITS) ||
- (gc->clientClipType != CT_NONE && (changes & (GCClipXOrigin | GCClipYOrigin)))) {
+ (has_clip(gc) && (changes & (GCClipXOrigin | GCClipYOrigin)))) {
DBG(("%s: recomputing clip\n", __FUNCTION__));
miComputeCompositeClip(gc, drawable);
DBG(("%s: composite clip=%dx[(%d, %d), (%d, %d)] [%p]\n",