summaryrefslogtreecommitdiff
path: root/afb
diff options
context:
space:
mode:
authorAdam Jackson <ajax@benzedrine.nwnk.net>2007-08-25 15:08:20 -0400
committerAdam Jackson <ajax@benzedrine.nwnk.net>2007-08-25 15:08:20 -0400
commitae7f71a8b3d6756161e55d998d6eec37d2695c98 (patch)
tree062e2a706da974db9e40c0fabf25c32355a26916 /afb
parentbf0883ae5081bd75569115a3eb27c6d3d336c9f2 (diff)
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.
Diffstat (limited to 'afb')
-rw-r--r--afb/Makefile.am2
-rw-r--r--afb/afb.h16
-rw-r--r--afb/afbbstore.c154
-rw-r--r--afb/afbscrinit.c9
4 files changed, 1 insertions, 180 deletions
diff --git a/afb/Makefile.am b/afb/Makefile.am
index d83b67417..d6b8901a1 100644
--- a/afb/Makefile.am
+++ b/afb/Makefile.am
@@ -10,7 +10,7 @@ libafb_la_SOURCES = afbgc.c afbwindow.c afbfont.c afbfillrct.c afbpntwin.c afbpi
afbimage.c afbline.c afbbres.c afbhrzvert.c afbbresd.c afbpushpxl.c afbply1rct.c \
afbzerarc.c afbfillarc.c afbfillsp.c afbsetsp.c afbscrinit.c afbplygblt.c \
afbclip.c afbgetsp.c afbpolypnt.c afbbitblt.c afbcmap.c afbimggblt.c afbpntarea.c \
- afbmisc.c afbbstore.c afbtegblt.c $(libafb_gen_sources)
+ afbmisc.c afbtegblt.c $(libafb_gen_sources)
INCLUDES = -I$(top_srcdir)/mfb -I$(top_srcdir)/hw/xfree86/os-support
diff --git a/afb/afb.h b/afb/afb.h
index 5aa2b0c92..9125951b3 100644
--- a/afb/afb.h
+++ b/afb/afb.h
@@ -182,23 +182,7 @@ extern void afbBresD(
unsigned char * /*rrops*/,
unsigned char * /*bgrrops*/
);
-/* afbbstore.c */
-extern void afbSaveAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnSave*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
-
-extern void afbRestoreAreas(
- PixmapPtr /*pPixmap*/,
- RegionPtr /*prgnRestore*/,
- int /*xorg*/,
- int /*yorg*/,
- WindowPtr /*pWin*/
-);
/* afbclip.c */
extern RegionPtr afbPixmapToRegion(
diff --git a/afb/afbbstore.c b/afb/afbbstore.c
deleted file mode 100644
index 32d64ec47..000000000
--- a/afb/afbbstore.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
-/*
-
-Copyright (c) 1987 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-*/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "afb.h"
-#include <X11/X.h>
-#include "mibstore.h"
-#include "regionstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-
-/*-
- *-----------------------------------------------------------------------
- * afbSaveAreas --
- * Function called by miSaveAreas to actually fetch the areas to be
- * saved into the backing pixmap. This is very simple to do, since
- * afbDoBitblt is designed for this very thing. The region to save is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the screen
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the screen into the pixmap.
- *
- *-----------------------------------------------------------------------
- */
-void
-afbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnSave; /* Region to save (pixmap-relative) */
- int xorg; /* X origin of region */
- int yorg; /* Y origin of region */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int numRects;
-
- numRects = REGION_NUM_RECTS(prgnSave);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects * sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnSave);
- pPt = pPtsInit;
- while (numRects--) {
- pPt->x = pBox->x1 + xorg;
- pPt->y = pBox->y1 + yorg;
- pPt++;
- pBox++;
- }
-
- afbDoBitblt((DrawablePtr)pPixmap->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr,
- (DrawablePtr)pPixmap,
- GXcopy,
- prgnSave,
- pPtsInit, wBackingBitPlanes (pWin));
-
- DEALLOCATE_LOCAL(pPtsInit);
-}
-
-/*-
- *-----------------------------------------------------------------------
- * afbRestoreAreas --
- * Function called by miRestoreAreas to actually fetch the areas to be
- * restored from the backing pixmap. This is very simple to do, since
- * afbDoBitblt is designed for this very thing. The region to restore is
- * already destination-relative and we're given the offset to the
- * window origin, so we have only to create an array of points of the
- * u.l. corners of the boxes in the region translated to the pixmap
- * coordinate system and fetch the screen pixmap out of its devPrivate
- * field....
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Data are copied from the pixmap into the screen.
- *
- *-----------------------------------------------------------------------
- */
-void
-afbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin)
- PixmapPtr pPixmap; /* Backing pixmap */
- RegionPtr prgnRestore; /* Region to restore (screen-relative)*/
- int xorg; /* X origin of window */
- int yorg; /* Y origin of window */
- WindowPtr pWin;
-{
- register DDXPointPtr pPt;
- DDXPointPtr pPtsInit;
- register BoxPtr pBox;
- register int numRects;
-
- numRects = REGION_NUM_RECTS(prgnRestore);
- pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(numRects*sizeof(DDXPointRec));
- if (!pPtsInit)
- return;
-
- pBox = REGION_RECTS(prgnRestore);
- pPt = pPtsInit;
- while (numRects--) {
- pPt->x = pBox->x1 - xorg;
- pPt->y = pBox->y1 - yorg;
- pPt++;
- pBox++;
- }
-
- afbDoBitblt((DrawablePtr)pPixmap,
- (DrawablePtr)pPixmap->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr,
- GXcopy,
- prgnRestore,
- pPtsInit, wBackingBitPlanes (pWin));
-
- DEALLOCATE_LOCAL(pPtsInit);
-}
diff --git a/afb/afbscrinit.c b/afb/afbscrinit.c
index 7cb742345..71e8d4c1e 100644
--- a/afb/afbscrinit.c
+++ b/afb/afbscrinit.c
@@ -77,14 +77,6 @@ int afbScreenPrivateIndex;
static unsigned long afbGeneration = 0;
-static BSFuncRec afbBSFuncRec = {
- afbSaveAreas,
- afbRestoreAreas,
- (BackingStoreSetClipmaskRgnProcPtr) 0,
- (BackingStoreGetImagePixmapProcPtr) 0,
- (BackingStoreGetSpansPixmapProcPtr) 0,
-};
-
static Bool
afbCloseScreen(int index, ScreenPtr pScreen)
{
@@ -231,7 +223,6 @@ afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, i
pScreen->CloseScreen = afbCloseScreen;
pScreen->CreateScreenResources = afbCreateScreenResources;
- pScreen->BackingStoreFuncs = afbBSFuncRec;
pScreen->devPrivates[afbScreenPrivateIndex].ptr = pScreen->devPrivate;
pScreen->devPrivate = oldDevPrivate;