From 462bf87c4d1c2211dd49a5ce62d01ff84ff33970 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 8 Oct 2014 17:20:33 +0200 Subject: render: Always store client clip as a region This does have one semantic change. FixesCreateRegionFromPicture used to throw BadImplementation if you tried to create a region from a picture with no client clip. I changed that to BadMatch here since that more honestly describes what's going on. Signed-off-by: Adam Jackson Reviewed-by: Keith Packard Signed-off-by: Keith Packard --- xfixes/region.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'xfixes') diff --git a/xfixes/region.c b/xfixes/region.c index f9de52542..4cfeee1a1 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -272,20 +272,12 @@ ProcXFixesCreateRegionFromPicture(ClientPtr client) if (!pPicture->pDrawable) return RenderErrBase + BadPicture; - switch (pPicture->clientClipType) { - case CT_PIXMAP: - pRegion = BitmapToRegion(pPicture->pDrawable->pScreen, - (PixmapPtr) pPicture->clientClip); - if (!pRegion) - return BadAlloc; - break; - case CT_REGION: + if (pPicture->clientClip) { pRegion = XFixesRegionCopy((RegionPtr) pPicture->clientClip); if (!pRegion) return BadAlloc; - break; - default: - return BadImplementation; /* assume sane server bits */ + } else { + return BadMatch; } if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) -- cgit v1.2.3