diff options
Diffstat (limited to 'mfb')
-rw-r--r-- | mfb/Makefile.am | 4 | ||||
-rw-r--r-- | mfb/mfb.h | 39 | ||||
-rw-r--r-- | mfb/mfbbitblt.c | 4 | ||||
-rw-r--r-- | mfb/mfbblt.c | 26 | ||||
-rw-r--r-- | mfb/mfbbstore.c | 154 | ||||
-rw-r--r-- | mfb/mfbfillrct.c | 4 | ||||
-rw-r--r-- | mfb/mfbfillsp.c | 108 | ||||
-rw-r--r-- | mfb/mfbimggblt.c | 4 | ||||
-rw-r--r-- | mfb/mfbpixmap.c | 9 | ||||
-rw-r--r-- | mfb/mfbplygblt.c | 4 | ||||
-rw-r--r-- | mfb/mfbpntwin.c | 126 | ||||
-rw-r--r-- | mfb/mfbpushpxl.c | 4 | ||||
-rw-r--r-- | mfb/mfbscrinit.c | 30 | ||||
-rw-r--r-- | mfb/mfbwindow.c | 180 |
14 files changed, 92 insertions, 604 deletions
diff --git a/mfb/Makefile.am b/mfb/Makefile.am index fe0bb1c26..274a32d7d 100644 --- a/mfb/Makefile.am +++ b/mfb/Makefile.am @@ -12,12 +12,12 @@ libmfb_gen_sources = mfbseg.c mfbpgbwht.c mfbpgbblak.c mfbpgbinv.c mfbigbwht.c \ DISTCLEANFILES = $(libmfb_gen_sources) libmfb_la_SOURCES = mfbgc.c mfbwindow.c mfbfont.c \ - mfbfillrct.c mfbpntwin.c maskbits.c mfbpixmap.c \ + mfbfillrct.c maskbits.c mfbpixmap.c \ mfbimage.c mfbline.c mfbbres.c mfbhrzvert.c mfbbresd.c \ mfbpushpxl.c mfbzerarc.c mfbfillarc.c \ mfbfillsp.c mfbsetsp.c mfbscrinit.c mfbscrclse.c mfbclip.c \ mfbbitblt.c mfbgetsp.c mfbpolypnt.c \ - mfbcmap.c mfbmisc.c mfbbstore.c $(libmfb_gen_sources) + mfbcmap.c mfbmisc.c $(libmfb_gen_sources) EXTRA_DIST = maskbits.h mergerop.h fastblt.h mfbline.c mfbblt.c mfbtile.c \ mfbplygblt.c mfbimggblt.c mfbpntarea.c mfbtegblt.c mfbply1rct.c @@ -205,23 +205,7 @@ extern void mfbBresD( int /*e2*/, int /*len*/ ); -/* mfbbstore.c */ -extern void mfbSaveAreas( - PixmapPtr /*pPixmap*/, - RegionPtr /*prgnSave*/, - int /*xorg*/, - int /*yorg*/, - WindowPtr /*pWin*/ -); - -extern void mfbRestoreAreas( - PixmapPtr /*pPixmap*/, - RegionPtr /*prgnRestore*/, - int /*xorg*/, - int /*yorg*/, - WindowPtr /*pWin*/ -); /* mfbclip.c */ extern RegionPtr mfbPixmapToRegion( @@ -603,7 +587,8 @@ extern PixmapPtr mfbCreatePixmap( ScreenPtr /*pScreen*/, int /*width*/, int /*height*/, - int /*depth*/ + int /*depth*/, + unsigned /*usage_hint*/ ); extern Bool mfbDestroyPixmap( @@ -665,13 +650,6 @@ extern void mfbFillPolyWhite( int /*count*/, DDXPointPtr /*ptsIn*/ ); -/* mfbpntwin.c */ - -extern void mfbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); /* mfbpolypnt.c */ extern void mfbPolyPoint( @@ -720,7 +698,6 @@ extern Bool mfbCloseScreen( extern Bool mfbAllocatePrivates( ScreenPtr /*pScreen*/, - int * /*pWinIndex*/, int * /*pGCIndex*/ ); @@ -909,24 +886,12 @@ typedef mfbPrivGC *mfbPrivGCPtr; /* XXX these should be static, but it breaks the ABI */ extern int mfbGCPrivateIndex; /* index into GC private array */ extern int mfbGetGCPrivateIndex(void); -extern int mfbWindowPrivateIndex; /* index into Window private array */ -extern int mfbGetWindowPrivateIndex(void); #ifdef PIXMAP_PER_WINDOW extern int frameWindowPrivateIndex; /* index into Window private array */ extern int frameGetWindowPrivateIndex(void); #endif #ifndef MFB_PROTOTYPES_ONLY -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; - } mfbPrivWin; - /* Common macros for extracting drawing information */ #define mfbGetTypedWidth(pDrawable,wtype) (\ diff --git a/mfb/mfbbitblt.c b/mfb/mfbbitblt.c index 0f84df354..153cf6ac6 100644 --- a/mfb/mfbbitblt.c +++ b/mfb/mfbbitblt.c @@ -351,7 +351,7 @@ int dstx, dsty; numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); @@ -370,7 +370,7 @@ int dstx, dsty; if (pGC->planemask & 1) (*localDoBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; diff --git a/mfb/mfbblt.c b/mfb/mfbblt.c index 4c3028126..b87a69797 100644 --- a/mfb/mfbblt.c +++ b/mfb/mfbblt.c @@ -119,13 +119,13 @@ MROP_NAME(mfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc) if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew1) return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -163,16 +163,16 @@ MROP_NAME(mfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc) if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); + if (pptNew2) xfree(pptNew2); + if (pboxNew2) xfree(pboxNew2); if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } return; } @@ -578,12 +578,12 @@ bits1 = *--psrc; --pdst; \ } if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); + xfree(pptNew2); + xfree(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } } diff --git a/mfb/mfbbstore.c b/mfb/mfbbstore.c deleted file mode 100644 index 784df4e84..000000000 --- a/mfb/mfbbstore.c +++ /dev/null @@ -1,154 +0,0 @@ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -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 OPEN GROUP 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 Open Group 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 Open Group. - -*/ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include "mfb.h" -#include <X11/X.h> -#include "mibstore.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" - -/*- - *----------------------------------------------------------------------- - * mfbSaveAreas -- - * Function called by miSaveAreas to actually fetch the areas to be - * saved into the backing pixmap. This is very simple to do, since - * mfbDoBitblt 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 -mfbSaveAreas(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++; - } - - mfbDoBitblt((DrawablePtr)pPixmap->drawable.pScreen->devPrivate, - (DrawablePtr)pPixmap, - GXcopy, - prgnSave, - pPtsInit); - - DEALLOCATE_LOCAL(pPtsInit); -} - -/*- - *----------------------------------------------------------------------- - * mfbRestoreAreas -- - * Function called by miRestoreAreas to actually fetch the areas to be - * restored from the backing pixmap. This is very simple to do, since - * mfbDoBitblt 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 -mfbRestoreAreas(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++; - } - - mfbDoBitblt((DrawablePtr)pPixmap, - (DrawablePtr)pPixmap->drawable.pScreen->devPrivate, - GXcopy, - prgnRestore, - pPtsInit); - - DEALLOCATE_LOCAL(pPtsInit); -} diff --git a/mfb/mfbfillrct.c b/mfb/mfbfillrct.c index f9209d096..594c7f01b 100644 --- a/mfb/mfbfillrct.c +++ b/mfb/mfbfillrct.c @@ -118,7 +118,7 @@ mfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -222,5 +222,5 @@ mfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) if (pboxClipped != pboxClippedBase) (*pfn) (pDrawable,pboxClipped-pboxClippedBase, pboxClippedBase, alu, ppix); if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } diff --git a/mfb/mfbfillsp.c b/mfb/mfbfillsp.c index 112f5327c..f83ca6a54 100644 --- a/mfb/mfbfillsp.c +++ b/mfb/mfbfillsp.c @@ -111,12 +111,12 @@ mfbBlackSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -151,8 +151,8 @@ mfbBlackSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -183,12 +183,12 @@ mfbWhiteSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -223,8 +223,8 @@ mfbWhiteSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -255,12 +255,12 @@ mfbInvertSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -295,8 +295,8 @@ mfbInvertSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -330,12 +330,12 @@ mfbWhiteStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -372,8 +372,8 @@ mfbWhiteStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -407,12 +407,12 @@ mfbBlackStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -449,8 +449,8 @@ mfbBlackStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -484,12 +484,12 @@ mfbInvertStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -526,8 +526,8 @@ mfbInvertStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pwidth++; ppt++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -603,12 +603,12 @@ mfbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -708,8 +708,8 @@ mfbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } break; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -746,12 +746,12 @@ mfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -873,8 +873,8 @@ mfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } @@ -912,12 +912,12 @@ mfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) return; n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -1021,6 +1021,6 @@ mfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } diff --git a/mfb/mfbimggblt.c b/mfb/mfbimggblt.c index e5c186b89..c21e82608 100644 --- a/mfb/mfbimggblt.c +++ b/mfb/mfbimggblt.c @@ -293,7 +293,7 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int getWidth; /* bits to get from glyph */ #endif - if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS)))) + if(!(ppos = (TEXTPOS *)xalloc(nglyph * sizeof(TEXTPOS)))) return; pdstBase = mfbScanlineNoBankSwitch(pdstBase, x, y, widthDst); @@ -434,7 +434,7 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) } } /* for each glyph */ } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); + xfree(ppos); break; } default: diff --git a/mfb/mfbpixmap.c b/mfb/mfbpixmap.c index e34972451..438e9ab57 100644 --- a/mfb/mfbpixmap.c +++ b/mfb/mfbpixmap.c @@ -69,11 +69,12 @@ SOFTWARE. PixmapPtr -mfbCreatePixmap (pScreen, width, height, depth) +mfbCreatePixmap (pScreen, width, height, depth, usage_hint) ScreenPtr pScreen; int width; int height; int depth; + unsigned usage_hint; { PixmapPtr pPixmap; size_t datasize; @@ -129,7 +130,7 @@ mfbCopyPixmap(pSrc) size = pSrc->drawable.height * pSrc->devKind; pScreen = pSrc->drawable.pScreen; pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width, - pSrc->drawable.height, pSrc->drawable.depth); + pSrc->drawable.height, pSrc->drawable.depth, 0); if (!pDst) return NullPixmap; memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); @@ -252,13 +253,13 @@ mfbYRotatePixmap(pPix, rh) nbyDown = rh * pPix->devKind; nbyUp = (pPix->devKind * height) - nbyDown; - if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) + if(!(ptmp = (char *)xalloc(nbyUp))) return; memmove(ptmp, pbase, nbyUp); /* save the low rows */ memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rh */ - DEALLOCATE_LOCAL(ptmp); + xfree(ptmp); } void diff --git a/mfb/mfbplygblt.c b/mfb/mfbplygblt.c index 997e4a388..1bd56e1ec 100644 --- a/mfb/mfbplygblt.c +++ b/mfb/mfbplygblt.c @@ -254,7 +254,7 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) int getWidth; /* bits to get from glyph */ #endif - if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS)))) + if(!(ppos = (TEXTPOS *)xalloc(nglyph * sizeof(TEXTPOS)))) return; pdstBase = mfbScanlineNoBankSwitch(pdstBase, x, y, widthDst); @@ -388,7 +388,7 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) } } /* for each glyph */ } /* while nbox-- */ - DEALLOCATE_LOCAL(ppos); + xfree(ppos); break; } default: diff --git a/mfb/mfbpntwin.c b/mfb/mfbpntwin.c deleted file mode 100644 index b18797a40..000000000 --- a/mfb/mfbpntwin.c +++ /dev/null @@ -1,126 +0,0 @@ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include <X11/X.h> - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "mfb.h" -#include "maskbits.h" -#include "mi.h" - -void -mfbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBackground); - return; - } - break; - case BackgroundPixel: - if (pWin->background.pixel & 1) - mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXset, NullPixmap); - else - mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXclear, NullPixmap); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - if (pWin->border.pixel & 1) - mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXset, NullPixmap); - else - mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXclear, NullPixmap); - return; - } - else if (pPrivWin->fastBorder) - { - mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBorder); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} diff --git a/mfb/mfbpushpxl.c b/mfb/mfbpushpxl.c index ddf7b3c0e..de9699252 100644 --- a/mfb/mfbpushpxl.c +++ b/mfb/mfbpushpxl.c @@ -132,7 +132,7 @@ mfbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) if (!REGION_NIL(&rgnDst)) { i = REGION_NUM_RECTS(&rgnDst); - pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec)); + pptSrc = (DDXPointPtr)xalloc(i * sizeof(DDXPointRec)); if(pptSrc) { for (pbox = REGION_RECTS(&rgnDst), ppt = pptSrc; @@ -143,7 +143,7 @@ mfbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) ppt->y = pbox->y1 - yOrg; } mfbDoBitblt((DrawablePtr)pBitMap, pDrawable, alu, &rgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } } REGION_UNINIT(pGC->pScreen, &rgnDst); diff --git a/mfb/mfbscrinit.c b/mfb/mfbscrinit.c index 0707c1a74..6d364b76c 100644 --- a/mfb/mfbscrinit.c +++ b/mfb/mfbscrinit.c @@ -71,8 +71,6 @@ SOFTWARE. int frameWindowPrivateIndex; int frameGetWindowPrivateIndex(void) { return frameWindowPrivateIndex; } #endif -int mfbWindowPrivateIndex; -int mfbGetWindowPrivateIndex(void) { return mfbWindowPrivateIndex; } int mfbGCPrivateIndex; int mfbGetGCPrivateIndex(void) { return mfbGCPrivateIndex; } static unsigned long mfbGeneration = 0; @@ -89,41 +87,24 @@ static DepthRec depth = { 1, 1, &VID }; - -BSFuncRec mfbBSFuncRec = { - mfbSaveAreas, - mfbRestoreAreas, - (BackingStoreSetClipmaskRgnProcPtr) 0, - (BackingStoreGetImagePixmapProcPtr) 0, - (BackingStoreGetSpansPixmapProcPtr) 0, -}; - - Bool -mfbAllocatePrivates(pScreen, pWinIndex, pGCIndex) - ScreenPtr pScreen; - int *pWinIndex, *pGCIndex; +mfbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex) { if (mfbGeneration != serverGeneration) { #ifdef PIXMAP_PER_WINDOW frameWindowPrivateIndex = AllocateWindowPrivateIndex(); #endif - mfbWindowPrivateIndex = AllocateWindowPrivateIndex(); mfbGCPrivateIndex = miAllocateGCPrivateIndex(); visual.vid = FakeClientID(0); VID = visual.vid; mfbGeneration = serverGeneration; } - if (pWinIndex) - *pWinIndex = mfbWindowPrivateIndex; if (pGCIndex) *pGCIndex = mfbGCPrivateIndex; pScreen->GetWindowPixmap = mfbGetWindowPixmap; pScreen->SetWindowPixmap = mfbSetWindowPixmap; - return (AllocateWindowPrivate(pScreen, mfbWindowPrivateIndex, - sizeof(mfbPrivWin)) && - AllocateGCPrivate(pScreen, mfbGCPrivateIndex, sizeof(mfbPrivGC))); + return AllocateGCPrivate(pScreen, mfbGCPrivateIndex, sizeof(mfbPrivGC)); } @@ -136,7 +117,7 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - if (!mfbAllocatePrivates(pScreen, (int *)NULL, (int *)NULL)) + if (!mfbAllocatePrivates(pScreen, NULL)) return FALSE; pScreen->defColormap = (Colormap) FakeClientID(0); /* whitePixel, blackPixel */ @@ -145,13 +126,9 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->GetImage = mfbGetImage; pScreen->GetSpans = mfbGetSpans; pScreen->CreateWindow = mfbCreateWindow; - pScreen->DestroyWindow = mfbDestroyWindow; pScreen->PositionWindow = mfbPositionWindow; - pScreen->ChangeWindowAttributes = mfbChangeWindowAttributes; pScreen->RealizeWindow = mfbMapWindow; pScreen->UnrealizeWindow = mfbUnmapWindow; - pScreen->PaintWindowBackground = mfbPaintWindow; - pScreen->PaintWindowBorder = mfbPaintWindow; pScreen->CopyWindow = mfbCopyWindow; pScreen->CreatePixmap = mfbCreatePixmap; pScreen->DestroyPixmap = mfbDestroyPixmap; @@ -169,7 +146,6 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, 1, 1, &depth, VID, 1, &visual)) return FALSE; - pScreen->BackingStoreFuncs = mfbBSFuncRec; return TRUE; } diff --git a/mfb/mfbwindow.c b/mfb/mfbwindow.c index b138d5805..30b8857b1 100644 --- a/mfb/mfbwindow.c +++ b/mfb/mfbwindow.c @@ -64,31 +64,14 @@ Bool mfbCreateWindow(pWin) register WindowPtr pWin; { - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - return (TRUE); } /* This always returns true, because Xfree can't fail. It might be possible * on some devices for Destroy to fail */ Bool -mfbDestroyWindow(pWin) - WindowPtr pWin; +mfbDestroyWindow(WindowPtr pWin) { - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); return (TRUE); } @@ -113,35 +96,6 @@ mfbPositionWindow(pWin, x, y) register WindowPtr pWin; int x, y; { - register mfbPrivWin *pPrivWin; - int reset = 0; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) - { - mfbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) - { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - if (reset) - { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - /* This is the "wrong" fix to the right problem, but it doesn't really * cost very much. When the window is moved, we need to invalidate any * RotatedPixmap that exists in any GC currently validated against this @@ -196,7 +150,7 @@ mfbCopyWindow(pWin, ptOldOrg, prgnSrc) pbox = REGION_RECTS(prgnDst); nbox = REGION_NUM_RECTS(prgnDst); - if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) + if(!(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) return; ppt = pptSrc; @@ -208,134 +162,6 @@ mfbCopyWindow(pWin, ptOldOrg, prgnSrc) mfbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst, pptSrc); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } - - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivate. -*/ -Bool -mfbChangeWindowAttributes(pWin, mask) - register WindowPtr pWin; - register unsigned long mask; -{ - register unsigned long index; - register mfbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && - pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) - { - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case CWBackPixmap: - if (pWin->backgroundState == None) - { - pPrivWin->fastBackground = FALSE; - } - else if (pWin->backgroundState == ParentRelative) - { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } - else if ((pWin->background.pixmap->drawable.width <= PPW) && - !(pWin->background.pixmap->drawable.width & - (pWin->background.pixmap->drawable.width - 1))) - { - mfbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, - pWin->drawable.y); - if (pPrivWin->pRotatedBackground) - { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - else - { - pPrivWin->fastBackground = FALSE; - } - } - else - { - pPrivWin->fastBackground = FALSE; - } - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if ((pWin->border.pixmap->drawable.width <= PPW) && - !(pWin->border.pixmap->drawable.width & - (pWin->border.pixmap->drawable.width - 1))) - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - mfbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, - pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) - { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - else - { - pPrivWin->fastBorder = FALSE; - } - } - else - { - pPrivWin->fastBorder = FALSE; - } - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } - /* Again, we have no failure modes indicated by any of the routines - * we've called, so we have to assume it worked */ - return (TRUE); -} |