exa: use PostCreateScreenResources hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new PostCreateScreenResources screen hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
b0f94e1c5c
commit
36f0cfcecf
22
exa/exa.c
22
exa/exa.c
|
@ -656,32 +656,18 @@ exaBitmapToRegion(PixmapPtr pPix)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static void exaCreateScreenResources(CallbackListPtr *pcbl, ScreenPtr pScreen, Bool *ret)
|
||||||
exaCreateScreenResources(ScreenPtr pScreen)
|
|
||||||
{
|
{
|
||||||
ExaScreenPriv(pScreen);
|
ExaScreenPriv(pScreen);
|
||||||
PixmapPtr pScreenPixmap;
|
PixmapPtr pScreenPixmap = pScreen->GetScreenPixmap(pScreen);
|
||||||
Bool b;
|
|
||||||
|
|
||||||
swap(pExaScr, pScreen, CreateScreenResources);
|
|
||||||
b = pScreen->CreateScreenResources(pScreen);
|
|
||||||
swap(pExaScr, pScreen, CreateScreenResources);
|
|
||||||
|
|
||||||
if (!b)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
pScreenPixmap = pScreen->GetScreenPixmap(pScreen);
|
|
||||||
|
|
||||||
if (pScreenPixmap) {
|
if (pScreenPixmap) {
|
||||||
ExaPixmapPriv(pScreenPixmap);
|
ExaPixmapPriv(pScreenPixmap);
|
||||||
|
|
||||||
exaSetAccelBlock(pExaScr, pExaPixmap,
|
exaSetAccelBlock(pExaScr, pExaPixmap,
|
||||||
pScreenPixmap->drawable.width,
|
pScreenPixmap->drawable.width,
|
||||||
pScreenPixmap->drawable.height,
|
pScreenPixmap->drawable.height,
|
||||||
pScreenPixmap->drawable.bitsPerPixel);
|
pScreenPixmap->drawable.bitsPerPixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -742,6 +728,7 @@ static void exaCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unuse
|
||||||
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
||||||
|
|
||||||
dixScreenUnhookClose(pScreen, exaCloseScreen);
|
dixScreenUnhookClose(pScreen, exaCloseScreen);
|
||||||
|
dixScreenUnhookPostCreateResources(pScreen, exaCreateScreenResources);
|
||||||
|
|
||||||
/* doesn't matter which one actually was registered */
|
/* doesn't matter which one actually was registered */
|
||||||
dixScreenUnhookPixmapDestroy(pScreen, exaPixmapDestroy_classic);
|
dixScreenUnhookPixmapDestroy(pScreen, exaPixmapDestroy_classic);
|
||||||
|
@ -765,7 +752,6 @@ static void exaCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unuse
|
||||||
unwrap(pExaScr, pScreen, CopyWindow);
|
unwrap(pExaScr, pScreen, CopyWindow);
|
||||||
unwrap(pExaScr, pScreen, ChangeWindowAttributes);
|
unwrap(pExaScr, pScreen, ChangeWindowAttributes);
|
||||||
unwrap(pExaScr, pScreen, BitmapToRegion);
|
unwrap(pExaScr, pScreen, BitmapToRegion);
|
||||||
unwrap(pExaScr, pScreen, CreateScreenResources);
|
|
||||||
if (pExaScr->SavedSharePixmapBacking)
|
if (pExaScr->SavedSharePixmapBacking)
|
||||||
unwrap(pExaScr, pScreen, SharePixmapBacking);
|
unwrap(pExaScr, pScreen, SharePixmapBacking);
|
||||||
if (pExaScr->SavedSetSharedPixmapBacking)
|
if (pExaScr->SavedSetSharedPixmapBacking)
|
||||||
|
@ -921,12 +907,12 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
|
||||||
wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler);
|
wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler);
|
||||||
wrap(pExaScr, pScreen, CreateGC, exaCreateGC);
|
wrap(pExaScr, pScreen, CreateGC, exaCreateGC);
|
||||||
dixScreenHookClose(pScreen, exaCloseScreen);
|
dixScreenHookClose(pScreen, exaCloseScreen);
|
||||||
|
dixScreenHookPostCreateResources(pScreen, exaCreateScreenResources);
|
||||||
wrap(pExaScr, pScreen, GetImage, exaGetImage);
|
wrap(pExaScr, pScreen, GetImage, exaGetImage);
|
||||||
wrap(pExaScr, pScreen, GetSpans, ExaCheckGetSpans);
|
wrap(pExaScr, pScreen, GetSpans, ExaCheckGetSpans);
|
||||||
wrap(pExaScr, pScreen, CopyWindow, exaCopyWindow);
|
wrap(pExaScr, pScreen, CopyWindow, exaCopyWindow);
|
||||||
wrap(pExaScr, pScreen, ChangeWindowAttributes, exaChangeWindowAttributes);
|
wrap(pExaScr, pScreen, ChangeWindowAttributes, exaChangeWindowAttributes);
|
||||||
wrap(pExaScr, pScreen, BitmapToRegion, exaBitmapToRegion);
|
wrap(pExaScr, pScreen, BitmapToRegion, exaBitmapToRegion);
|
||||||
wrap(pExaScr, pScreen, CreateScreenResources, exaCreateScreenResources);
|
|
||||||
|
|
||||||
if (ps) {
|
if (ps) {
|
||||||
wrap(pExaScr, ps, Composite, exaComposite);
|
wrap(pExaScr, ps, Composite, exaComposite);
|
||||||
|
|
|
@ -158,7 +158,6 @@ typedef struct {
|
||||||
CopyWindowProcPtr SavedCopyWindow;
|
CopyWindowProcPtr SavedCopyWindow;
|
||||||
ChangeWindowAttributesProcPtr SavedChangeWindowAttributes;
|
ChangeWindowAttributesProcPtr SavedChangeWindowAttributes;
|
||||||
BitmapToRegionProcPtr SavedBitmapToRegion;
|
BitmapToRegionProcPtr SavedBitmapToRegion;
|
||||||
CreateScreenResourcesProcPtr SavedCreateScreenResources;
|
|
||||||
ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader;
|
ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader;
|
||||||
SharePixmapBackingProcPtr SavedSharePixmapBacking;
|
SharePixmapBackingProcPtr SavedSharePixmapBacking;
|
||||||
SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
|
SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
|
||||||
|
|
Loading…
Reference in New Issue