mi: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping jungle, so use the proper dix function instead. See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1711>
This commit is contained in:
parent
372a510ef0
commit
4628254698
|
@ -1112,7 +1112,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (fTricky) {
|
if (fTricky) {
|
||||||
(*pGCTo->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo);
|
dixDestroyPixmap((PixmapPtr) pDrawTo, 0);
|
||||||
FreeScratchGC(pGCTo);
|
FreeScratchGC(pGCTo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,12 +119,11 @@ miDCSwitchScreenCursor(ScreenPtr pScreen, CursorPtr pCursor, PixmapPtr sourceBit
|
||||||
{
|
{
|
||||||
miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey);
|
miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey);
|
||||||
|
|
||||||
if (pScreenPriv->sourceBits)
|
dixDestroyPixmap(pScreenPriv->sourceBits, 0);
|
||||||
(*pScreen->DestroyPixmap)(pScreenPriv->sourceBits);
|
|
||||||
pScreenPriv->sourceBits = sourceBits;
|
pScreenPriv->sourceBits = sourceBits;
|
||||||
|
|
||||||
if (pScreenPriv->maskBits)
|
if (pScreenPriv->maskBits)
|
||||||
(*pScreen->DestroyPixmap)(pScreenPriv->maskBits);
|
dixDestroyPixmap(pScreenPriv->maskBits, 0);
|
||||||
pScreenPriv->maskBits = maskBits;
|
pScreenPriv->maskBits = maskBits;
|
||||||
|
|
||||||
if (pScreenPriv->pPicture)
|
if (pScreenPriv->pPicture)
|
||||||
|
@ -203,7 +202,7 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
|
|
||||||
pGC = GetScratchGC(32, pScreen);
|
pGC = GetScratchGC(32, pScreen);
|
||||||
if (!pGC) {
|
if (!pGC) {
|
||||||
(*pScreen->DestroyPixmap) (pPixmap);
|
dixDestroyPixmap(pPixmap, 0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
ValidateGC(&pPixmap->drawable, pGC);
|
ValidateGC(&pPixmap->drawable, pGC);
|
||||||
|
@ -214,7 +213,7 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
FreeScratchGC(pGC);
|
FreeScratchGC(pGC);
|
||||||
pPicture = CreatePicture(0, &pPixmap->drawable,
|
pPicture = CreatePicture(0, &pPixmap->drawable,
|
||||||
pFormat, 0, 0, serverClient, &error);
|
pFormat, 0, 0, serverClient, &error);
|
||||||
(*pScreen->DestroyPixmap) (pPixmap);
|
dixDestroyPixmap(pPixmap, 0);
|
||||||
if (!pPicture)
|
if (!pPicture)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -230,7 +229,7 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
|
maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
|
||||||
pCursor->bits->height, 1, 0);
|
pCursor->bits->height, 1, 0);
|
||||||
if (!maskBits) {
|
if (!maskBits) {
|
||||||
(*pScreen->DestroyPixmap) (sourceBits);
|
dixDestroyPixmap(sourceBits, 0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,8 +237,8 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
|
|
||||||
pGC = GetScratchGC(1, pScreen);
|
pGC = GetScratchGC(1, pScreen);
|
||||||
if (!pGC) {
|
if (!pGC) {
|
||||||
(*pScreen->DestroyPixmap) (sourceBits);
|
dixDestroyPixmap(sourceBits, 0);
|
||||||
(*pScreen->DestroyPixmap) (maskBits);
|
dixDestroyPixmap(maskBits, 0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,8 +394,7 @@ miDCSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
pSave = pBuffer->pSave;
|
pSave = pBuffer->pSave;
|
||||||
pWin = pScreen->root;
|
pWin = pScreen->root;
|
||||||
if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h) {
|
if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h) {
|
||||||
if (pSave)
|
dixDestroyPixmap(pSave, 0);
|
||||||
(*pScreen->DestroyPixmap) (pSave);
|
|
||||||
pBuffer->pSave = pSave =
|
pBuffer->pSave = pSave =
|
||||||
(*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth, 0);
|
(*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth, 0);
|
||||||
if (!pSave)
|
if (!pSave)
|
||||||
|
@ -513,8 +511,7 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
||||||
* is freed when that root window is destroyed, so don't
|
* is freed when that root window is destroyed, so don't
|
||||||
* free it again here. */
|
* free it again here. */
|
||||||
|
|
||||||
if (pBuffer->pSave)
|
dixDestroyPixmap(pBuffer->pSave, 0);
|
||||||
(*pScreen->DestroyPixmap) (pBuffer->pSave);
|
|
||||||
|
|
||||||
free(pBuffer);
|
free(pBuffer);
|
||||||
dixSetScreenPrivate(&pDev->devPrivates, miDCDeviceKey, pScreen,
|
dixSetScreenPrivate(&pDev->devPrivates, miDCDeviceKey, pScreen,
|
||||||
|
|
|
@ -63,7 +63,7 @@ miChangeClip(GCPtr pGC, int type, void *pvalue, int nrects)
|
||||||
if (type == CT_PIXMAP) {
|
if (type == CT_PIXMAP) {
|
||||||
/* convert the pixmap to a region */
|
/* convert the pixmap to a region */
|
||||||
pGC->clientClip = BitmapToRegion(pGC->pScreen, (PixmapPtr) pvalue);
|
pGC->clientClip = BitmapToRegion(pGC->pScreen, (PixmapPtr) pvalue);
|
||||||
(*pGC->pScreen->DestroyPixmap) (pvalue);
|
dixDestroyPixmap(pvalue, 0);
|
||||||
}
|
}
|
||||||
else if (type == CT_REGION) {
|
else if (type == CT_REGION) {
|
||||||
/* stuff the region in the GC */
|
/* stuff the region in the GC */
|
||||||
|
|
|
@ -118,7 +118,7 @@ miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyp
|
||||||
|
|
||||||
pGCtmp = GetScratchGC(1, pDrawable->pScreen);
|
pGCtmp = GetScratchGC(1, pDrawable->pScreen);
|
||||||
if (!pGCtmp) {
|
if (!pGCtmp) {
|
||||||
(*pDrawable->pScreen->DestroyPixmap) (pPixmap);
|
dixDestroyPixmap(pPixmap, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyp
|
||||||
nbyLine = BitmapBytePad(width);
|
nbyLine = BitmapBytePad(width);
|
||||||
pbits = xallocarray(height, nbyLine);
|
pbits = xallocarray(height, nbyLine);
|
||||||
if (!pbits) {
|
if (!pbits) {
|
||||||
(*pDrawable->pScreen->DestroyPixmap) (pPixmap);
|
dixDestroyPixmap(pPixmap, 0);
|
||||||
FreeScratchGC(pGCtmp);
|
FreeScratchGC(pGCtmp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyp
|
||||||
}
|
}
|
||||||
x += pci->metrics.characterWidth;
|
x += pci->metrics.characterWidth;
|
||||||
}
|
}
|
||||||
(*pDrawable->pScreen->DestroyPixmap) (pPixmap);
|
dixDestroyPixmap(pPixmap, 0);
|
||||||
free(pbits);
|
free(pbits);
|
||||||
FreeScratchGC(pGCtmp);
|
FreeScratchGC(pGCtmp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,8 @@ miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
|
||||||
static Bool
|
static Bool
|
||||||
miCloseScreen(ScreenPtr pScreen)
|
miCloseScreen(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate));
|
dixDestroyPixmap((PixmapPtr) pScreen->devPrivate, 0);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
|
Loading…
Reference in New Issue