mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
exa: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new pixmap destroy notify hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -206,42 +206,26 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height,
|
||||
return ret;
|
||||
}
|
||||
|
||||
Bool
|
||||
exaDestroyPixmap_classic(PixmapPtr pPixmap)
|
||||
void exaPixmapDestroy_classic(CallbackListPtr *pcbl, ScreenPtr pScreen, PixmapPtr pPixmap)
|
||||
{
|
||||
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
||||
ExaPixmapPriv(pPixmap);
|
||||
if (!pExaPixmap) // we're called on an error path
|
||||
return;
|
||||
|
||||
ExaScreenPriv(pScreen);
|
||||
Bool ret = TRUE;
|
||||
exaDestroyPixmap(pPixmap);
|
||||
|
||||
if (pPixmap->refcnt == 1) {
|
||||
ExaPixmapPriv(pPixmap);
|
||||
if (!pExaPixmap) // we're called on an error path
|
||||
goto out;
|
||||
|
||||
exaDestroyPixmap(pPixmap);
|
||||
|
||||
if (pExaPixmap->area) {
|
||||
DBG_PIXMAP(("-- 0x%p (0x%x) (%dx%d)\n",
|
||||
(void *) pPixmap->drawable.id,
|
||||
ExaGetPixmapPriv(pPixmap)->area->offset,
|
||||
pPixmap->drawable.width, pPixmap->drawable.height));
|
||||
/* Free the offscreen area */
|
||||
exaOffscreenFree(pPixmap->drawable.pScreen, pExaPixmap->area);
|
||||
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
|
||||
pPixmap->devKind = pExaPixmap->sys_pitch;
|
||||
}
|
||||
RegionUninit(&pExaPixmap->validSys);
|
||||
RegionUninit(&pExaPixmap->validFB);
|
||||
if (pExaPixmap->area) {
|
||||
DBG_PIXMAP(("-- 0x%p (0x%x) (%dx%d)\n",
|
||||
(void *) pPixmap->drawable.id,
|
||||
ExaGetPixmapPriv(pPixmap)->area->offset,
|
||||
pPixmap->drawable.width, pPixmap->drawable.height));
|
||||
/* Free the offscreen area */
|
||||
exaOffscreenFree(pPixmap->drawable.pScreen, pExaPixmap->area);
|
||||
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
|
||||
pPixmap->devKind = pExaPixmap->sys_pitch;
|
||||
}
|
||||
|
||||
out:
|
||||
// restore original (screen driver's) DestroyPixmap() handler and call it
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
dixDestroyPixmap(pPixmap, 0);
|
||||
swap(pExaScr, pScreen, DestroyPixmap);
|
||||
|
||||
return ret;
|
||||
RegionUninit(&pExaPixmap->validSys);
|
||||
RegionUninit(&pExaPixmap->validFB);
|
||||
}
|
||||
|
||||
Bool
|
||||
|
||||
Reference in New Issue
Block a user