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 <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Adam Jackson
2014-10-08 17:20:33 +02:00
committed by Keith Packard
parent 3f4edd2e3f
commit 462bf87c4d
6 changed files with 13 additions and 43 deletions

View File

@@ -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))