summaryrefslogtreecommitdiff
path: root/afb
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-11-05 19:08:36 -0500
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-11-05 19:08:36 -0500
commita52c9b2a59f27266557ff9d5d2c08492e04135a6 (patch)
tree705f11c54e8a31a07dde9ab6835032e2849e132b /afb
parentc7e18beb3c87eb1ada9b21c4ffacd11c1939c087 (diff)
parent58332894c061ae96d6a457f65266660f5f65e88b (diff)
Merge branch 'master' into XACE-SELINUX
Conflicts: dix/dispatch.c dix/property.c hw/xfree86/common/xf86VidMode.c include/xkbsrv.h render/glyph.c xkb/xkbActions.c
Diffstat (limited to 'afb')
-rw-r--r--afb/afb.h3
-rw-r--r--afb/afbbitblt.c4
-rw-r--r--afb/afbblt.c26
-rw-r--r--afb/afbfillrct.c4
-rw-r--r--afb/afbfillsp.c84
-rw-r--r--afb/afbimage.c3
-rw-r--r--afb/afbimggblt.c4
-rw-r--r--afb/afbpixmap.c13
-rw-r--r--afb/afbplygblt.c4
-rw-r--r--afb/afbwindow.c4
10 files changed, 77 insertions, 72 deletions
diff --git a/afb/afb.h b/afb/afb.h
index 21110307a..6731d9557 100644
--- a/afb/afb.h
+++ b/afb/afb.h
@@ -483,7 +483,8 @@ extern PixmapPtr afbCreatePixmap(
ScreenPtr /*pScreen*/,
int /*width*/,
int /*height*/,
- int /*depth*/
+ int /*depth*/,
+ unsigned /*usage_hint*/
);
extern Bool afbDestroyPixmap(
diff --git a/afb/afbbitblt.c b/afb/afbbitblt.c
index 2e416e356..d8b2ccda5 100644
--- a/afb/afbbitblt.c
+++ b/afb/afbbitblt.c
@@ -279,7 +279,7 @@ afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable,
/* Do bit blitting */
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);
if (freeSrcClip)
@@ -296,7 +296,7 @@ afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable,
(*doBitBlt)(pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc,
planemask);
- DEALLOCATE_LOCAL(pptSrc);
+ xfree(pptSrc);
}
prgnExposed = NULL;
diff --git a/afb/afbblt.c b/afb/afbblt.c
index 9eb4e4732..4e1a49e9d 100644
--- a/afb/afbblt.c
+++ b/afb/afbblt.c
@@ -132,12 +132,12 @@ MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
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;
@@ -169,16 +169,16 @@ MROP_NAME(afbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
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);
+ xfree(pptNew2);
if (pboxNew2)
- DEALLOCATE_LOCAL(pboxNew2);
+ xfree(pboxNew2);
if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
- DEALLOCATE_LOCAL(pboxNew1);
+ xfree(pptNew1);
+ xfree(pboxNew1);
}
return;
}
@@ -553,11 +553,11 @@ bits1 = *--psrc; --pdst; \
pptSrc++;
}
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/afb/afbfillrct.c b/afb/afbfillrct.c
index b4936f097..4dff9576f 100644
--- a/afb/afbfillrct.c
+++ b/afb/afbfillrct.c
@@ -112,7 +112,7 @@ afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre
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;
}
@@ -288,5 +288,5 @@ afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre
}
}
if (pboxClippedBase != stackRects)
- DEALLOCATE_LOCAL(pboxClippedBase);
+ xfree(pboxClippedBase);
}
diff --git a/afb/afbfillsp.c b/afb/afbfillsp.c
index 0118b475a..16295067b 100644
--- a/afb/afbfillsp.c
+++ b/afb/afbfillsp.c
@@ -109,11 +109,11 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
unsigned char *rrops;
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;
@@ -184,8 +184,8 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
pwidth++;
ppt++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
void
@@ -220,11 +220,11 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
unsigned char *rrops;
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;
@@ -298,8 +298,8 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
pwidth++;
ppt++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
void
@@ -334,11 +334,11 @@ afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int d;
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;
@@ -429,8 +429,8 @@ afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
break;
}
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
void
@@ -466,11 +466,11 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int d;
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;
@@ -588,8 +588,8 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
break;
}
} /* switch (rop) */
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
/* Fill spans with tiles that aren't PPW bits wide */
@@ -627,11 +627,11 @@ afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
register int d;
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;
@@ -733,8 +733,8 @@ afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++;
pwidth++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
/* Fill spans with stipples that aren't PPW bits wide */
@@ -773,11 +773,11 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int depthDst;
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;
@@ -878,8 +878,8 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++;
pwidth++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
/* Fill spans with OpaqueStipples that aren't PPW bits wide */
@@ -919,11 +919,11 @@ afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int depthDst;
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;
@@ -1125,6 +1125,6 @@ afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++;
pwidth++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
diff --git a/afb/afbimage.c b/afb/afbimage.c
index 81f49730a..890429fe6 100644
--- a/afb/afbimage.c
+++ b/afb/afbimage.c
@@ -72,7 +72,8 @@ afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage)
int depthDst;
/* Create a tmp pixmap */
- pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth);
+ pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth,
+ CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap)
return;
diff --git a/afb/afbimggblt.c b/afb/afbimggblt.c
index 824f918bc..36818ac50 100644
--- a/afb/afbimggblt.c
+++ b/afb/afbimggblt.c
@@ -298,7 +298,7 @@ afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
int getWidth; /* bits to get from glyph */
#endif
- if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS))))
+ if(!(ppos = (afbTEXTPOS *)xalloc(nglyph * sizeof(afbTEXTPOS))))
return;
pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
@@ -462,7 +462,7 @@ afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
} /* depth */
} /* for each glyph */
} /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
+ xfree(ppos);
break;
}
diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c
index 5ae50fb70..18d001771 100644
--- a/afb/afbpixmap.c
+++ b/afb/afbpixmap.c
@@ -70,11 +70,12 @@ SOFTWARE.
#include "mfb.h"
PixmapPtr
-afbCreatePixmap(pScreen, width, height, depth)
+afbCreatePixmap(pScreen, width, height, depth, usage_hint)
ScreenPtr pScreen;
int width;
int height;
int depth;
+ unsigned usage_hint;
{
PixmapPtr pPixmap;
size_t datasize;
@@ -128,8 +129,10 @@ afbCopyPixmap(PixmapPtr pSrc)
size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth;
pScreen = pSrc->drawable.pScreen;
- pDst = (*pScreen->CreatePixmap)(pScreen, pSrc->drawable.width,
- pSrc->drawable.height, pSrc->drawable.depth);
+ pDst = (*pScreen->CreatePixmap)(pScreen,
+ pSrc->drawable.width,
+ pSrc->drawable.height,
+ pSrc->drawable.depth, 0);
if (!pDst)
return(NullPixmap);
memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);
@@ -249,7 +252,7 @@ afbYRotatePixmap(pPix, rh)
nbyDown = rh * pPix->devKind;
nbyUp = (pPix->devKind * height) - nbyDown;
- if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp)))
+ if(!(ptmp = (char *)xalloc(nbyUp)))
return;
for (d = 0; d < pPix->drawable.depth; d++) {
@@ -259,7 +262,7 @@ afbYRotatePixmap(pPix, rh)
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/afb/afbplygblt.c b/afb/afbplygblt.c
index 79b269b85..d1de102d7 100644
--- a/afb/afbplygblt.c
+++ b/afb/afbplygblt.c
@@ -278,7 +278,7 @@ afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
int getWidth; /* bits to get from glyph */
#endif
- if(!(ppos = (afbTEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(afbTEXTPOS))))
+ if(!(ppos = (afbTEXTPOS *)xalloc(nglyph * sizeof(afbTEXTPOS))))
return;
pdstBase = afbScanlineNoBankSwitch(pdstBase, x, y, widthDst);
@@ -453,7 +453,7 @@ afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
} /* depth */
} /* for each glyph */
} /* while nbox-- */
- DEALLOCATE_LOCAL(ppos);
+ xfree(ppos);
break;
}
diff --git a/afb/afbwindow.c b/afb/afbwindow.c
index b2c679274..c0dee980d 100644
--- a/afb/afbwindow.c
+++ b/afb/afbwindow.c
@@ -142,7 +142,7 @@ afbCopyWindow(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;
@@ -153,7 +153,7 @@ afbCopyWindow(pWin, ptOldOrg, prgnSrc)
afbDoBitblt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, prgnDst,
pptSrc, ~0);
- DEALLOCATE_LOCAL(pptSrc);
+ xfree(pptSrc);
REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
}