Implement core protocol backing store exclusively in terms of Composite.

Composite's automatic redirection is a more general mechanism than the
ad-hoc BS machinery, so it's much prettier to implement the one in terms
of the other.  Composite now wraps ChangeWindowAttributes and activates
automatic redirection for windows with backing store requested.  The old
backing store infrastructure is completely gutted: ABI-visible structures
retain the function pointers, but they never get called, and all the
open-coded conditionals throughout the DIX layer to implement BS are gone.

Note that this is still not a strictly complete implementation of backing
store, since Composite will throw the bits away on unmap and therefore
WhenMapped and Always hints are equivalent.
This commit is contained in:
Adam Jackson 2007-08-25 15:08:20 -04:00
commit ae7f71a8b3
67 changed files with 80 additions and 5959 deletions

View file

@ -102,7 +102,6 @@ typedef struct _RACScreen {
PaintWindowBorderProcPtr PaintWindowBorder;
CopyWindowProcPtr CopyWindow;
ClearToBackgroundProcPtr ClearToBackground;
BSFuncRec BackingStoreFuncs;
CreatePixmapProcPtr CreatePixmap;
SaveScreenProcPtr SaveScreen;
/* Colormap */
@ -146,10 +145,6 @@ static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
RegionPtr prgnSrc );
static void RACClearToBackground (WindowPtr pWin, int x, int y,
int w, int h, Bool generateExposures );
static void RACSaveAreas (PixmapPtr pPixmap, RegionPtr prgnSave,
int xorg, int yorg, WindowPtr pWin);
static void RACRestoreAreas (PixmapPtr pPixmap, RegionPtr prgnRestore,
int xorg, int yorg, WindowPtr pWin);
static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth);
static Bool RACCreateGC(GCPtr pGC);
static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank);
@ -306,8 +301,6 @@ xf86RACInit(ScreenPtr pScreen, unsigned int flag)
WRAP_SCREEN_COND(CopyWindow, RACCopyWindow, RAC_FB);
WRAP_SCREEN_COND(ClearToBackground, RACClearToBackground, RAC_FB);
WRAP_SCREEN_COND(CreatePixmap, RACCreatePixmap, RAC_FB);
WRAP_SCREEN_COND(BackingStoreFuncs.RestoreAreas, RACRestoreAreas, RAC_FB);
WRAP_SCREEN_COND(BackingStoreFuncs.SaveAreas, RACSaveAreas, RAC_FB);
WRAP_SCREEN_COND(StoreColors, RACStoreColors, RAC_COLORMAP);
WRAP_SCREEN_COND(DisplayCursor, RACDisplayCursor, RAC_CURSOR);
WRAP_SCREEN_COND(RealizeCursor, RACRealizeCursor, RAC_CURSOR);
@ -352,8 +345,6 @@ RACCloseScreen (int i, ScreenPtr pScreen)
UNWRAP_SCREEN(PaintWindowBorder);
UNWRAP_SCREEN(CopyWindow);
UNWRAP_SCREEN(ClearToBackground);
UNWRAP_SCREEN(BackingStoreFuncs.RestoreAreas);
UNWRAP_SCREEN(BackingStoreFuncs.SaveAreas);
UNWRAP_SCREEN(SaveScreen);
UNWRAP_SCREEN(StoreColors);
UNWRAP_SCREEN(DisplayCursor);
@ -498,45 +489,6 @@ RACClearToBackground (
SCREEN_EPILOG (ClearToBackground, RACClearToBackground);
}
static void
RACSaveAreas (
PixmapPtr pPixmap,
RegionPtr prgnSave,
int xorg,
int yorg,
WindowPtr pWin
)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
DPRINT_S("RACSaveAreas",pScreen->myNum);
SCREEN_PROLOG (BackingStoreFuncs.SaveAreas);
ENABLE;
(*pScreen->BackingStoreFuncs.SaveAreas) (
pPixmap, prgnSave, xorg, yorg, pWin);
SCREEN_EPILOG (BackingStoreFuncs.SaveAreas, RACSaveAreas);
}
static void
RACRestoreAreas (
PixmapPtr pPixmap,
RegionPtr prgnRestore,
int xorg,
int yorg,
WindowPtr pWin
)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
DPRINT_S("RACRestoreAreas",pScreen->myNum);
SCREEN_PROLOG (BackingStoreFuncs.RestoreAreas);
ENABLE;
(*pScreen->BackingStoreFuncs.RestoreAreas) (
pPixmap, prgnRestore, xorg, yorg, pWin);
SCREEN_EPILOG ( BackingStoreFuncs.RestoreAreas, RACRestoreAreas);
}
static PixmapPtr
RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
{