dix: Always store GC client clip as a region (v2)

Again, this changes FixesCreateRegionFromGC to throw BadMatch when fed a
GC with no client clip.

v2: Fix Xnest and some variable names (Keith)

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2014-06-20 13:31:20 -04:00
commit 73e2383b73
15 changed files with 53 additions and 133 deletions

View file

@ -222,20 +222,13 @@ ProcXFixesCreateRegionFromGC(ClientPtr client)
if (rc != Success)
return rc;
switch (pGC->clientClipType) {
case CT_PIXMAP:
pRegion = BitmapToRegion(pGC->pScreen, (PixmapPtr) pGC->clientClip);
if (!pRegion)
return BadAlloc;
break;
case CT_REGION:
if (pGC->clientClip) {
pClip = (RegionPtr) pGC->clientClip;
pRegion = XFixesRegionCopy(pClip);
if (!pRegion)
return BadAlloc;
break;
default:
return BadImplementation; /* assume sane server bits */
} else {
return BadMatch;
}
if (!AddResource(stuff->region, RegionResType, (void *) pRegion))