diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-10-24 08:02:50 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-10-24 08:04:27 +0100 |
commit | 8df8618c62c0918416ca3e21b081299eacb9b054 (patch) | |
tree | 2841e547029d3e1a82097047dc7f276cd75a353e | |
parent | a8d1eaf6ee1fed0aeff681d33864e17cb904ddd3 (diff) |
sna: Adapt to changes in internal render API in Xorg-1.17
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/fb/fbpict.c | 12 | ||||
-rw-r--r-- | src/sna/sna_composite.c | 16 |
2 files changed, 24 insertions, 4 deletions
diff --git a/src/sna/fb/fbpict.c b/src/sna/fb/fbpict.c index 906a5f31..abe223f3 100644 --- a/src/sna/fb/fbpict.c +++ b/src/sna/fb/fbpict.c @@ -156,6 +156,16 @@ create_conical_gradient_image(PictGradient * gradient) gradient->nstops); } +static inline bool +picture_has_clip(PicturePtr p) +{ +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,16,99,1,0) + return p->clientClip; +#else + return p->clientClipType != CT_NONE; +#endif +} + static pixman_image_t * create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) { @@ -180,7 +190,7 @@ create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) * only set the clip region for pictures with drawables */ if (has_clip) { - if (pict->clientClipType != CT_NONE) + if (picture_has_clip(pict)) pixman_image_set_has_client_clip(image, TRUE); if (*xoff || *yoff) diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index c76258cb..3753afa9 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -122,11 +122,21 @@ clip_to_dst(pixman_region16_t *region, } static inline bool +picture_has_clip(PicturePtr p) +{ +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,16,99,1,0) + return p->clientClip; +#else + return p->clientClipType != CT_NONE; +#endif +} + +static inline bool clip_to_src(RegionPtr region, PicturePtr p, int dx, int dy) { bool result; - if (p->clientClipType == CT_NONE) + if (!picture_has_clip(p)) return true; pixman_region_translate(p->clientClip, @@ -220,7 +230,7 @@ sna_compute_composite_region(RegionPtr region, __FUNCTION__, src->pDrawable ? src->pDrawable->width : 0, src->pDrawable ? src->pDrawable->height : 0, - src->clientClipType, + picture_has_clip(src), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2)); @@ -287,7 +297,7 @@ trim_extents(BoxPtr extents, const PicturePtr p, int dx, int dy) static void _trim_source_extents(BoxPtr extents, const PicturePtr p, int dx, int dy) { - if (p->clientClipType != CT_NONE) + if (picture_has_clip(p)) trim_extents(extents, p, dx, dy); } |