diff options
author | David Reveman <c99drn@cs.umu.se> | 2006-03-30 16:39:31 +0000 |
---|---|---|
committer | David Reveman <c99drn@cs.umu.se> | 2006-03-30 16:39:31 +0000 |
commit | 5e2b6cd89c35394192400c3959f7ad50fe8732ff (patch) | |
tree | 502e7957987d2401ce2dec550dc49a750f6612e9 /afb | |
parent | f289aa06b6cacb540c12c81d8a957020d3f95190 (diff) |
sync to head
Diffstat (limited to 'afb')
-rw-r--r-- | afb/afb.h | 5 | ||||
-rw-r--r-- | afb/afbbitblt.c | 50 | ||||
-rw-r--r-- | afb/afbblt.c | 2 | ||||
-rw-r--r-- | afb/afbclip.c | 2 | ||||
-rw-r--r-- | afb/afbcmap.c | 41 | ||||
-rw-r--r-- | afb/afbfillarc.c | 17 | ||||
-rw-r--r-- | afb/afbfillrct.c | 11 | ||||
-rw-r--r-- | afb/afbgc.c | 2 | ||||
-rw-r--r-- | afb/afbimage.c | 2 | ||||
-rw-r--r-- | afb/afbline.c | 1 | ||||
-rw-r--r-- | afb/afbpixmap.c | 2 | ||||
-rw-r--r-- | afb/afbply1rct.c | 2 | ||||
-rw-r--r-- | afb/afbpushpxl.c | 94 | ||||
-rw-r--r-- | afb/afbscrinit.c | 38 | ||||
-rw-r--r-- | afb/afbwindow.c | 2 | ||||
-rw-r--r-- | afb/afbzerarc.c | 11 |
16 files changed, 65 insertions, 217 deletions
@@ -1125,8 +1125,3 @@ typedef struct _afbpos{ #define MFB_EQWHOLEWORD_INVERT ^=~0 #define MFB_OP_WHITE /* nothing */ #define MFB_OP_BLACK ~ - -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#endif - diff --git a/afb/afbbitblt.c b/afb/afbbitblt.c index 0c1c6bb9f..7c4502c93 100644 --- a/afb/afbbitblt.c +++ b/afb/afbbitblt.c @@ -53,6 +53,8 @@ SOFTWARE. #include <dix-config.h> #endif +#include <stdlib.h> + #include <X11/X.h> #include <X11/Xprotostr.h> @@ -102,12 +104,7 @@ destination. this is a simple translation. */ void -afbDoBitblt(pSrc, pDst, alu, prgnDst, pptSrc, planemask) - DrawablePtr pSrc, pDst; - int alu; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; +afbDoBitblt(DrawablePtr pSrc, DrawablePtr pDst, int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, long unsigned int planemask) { switch (alu) { case GXcopy: @@ -128,17 +125,13 @@ afbDoBitblt(pSrc, pDst, alu, prgnDst, pptSrc, planemask) } } +typedef void (*afb_blit_func) + (DrawablePtr, DrawablePtr, int, RegionPtr, DDXPointPtr, unsigned long); + RegionPtr -afbCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, - dstx, dsty) - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - GC *pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; +afbCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { - void (*doBitBlt)(); + afb_blit_func doBitBlt; switch (pGC->alu) { case GXcopy: @@ -163,16 +156,7 @@ afbCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, } RegionPtr -afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, - dstx, dsty, doBitBlt, planemask) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - register GC *pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - void (*doBitBlt)(); - unsigned long planemask; +afbBitBlt(register DrawablePtr pSrcDrawable, register DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, afb_blit_func doBitBlt, long unsigned int planemask) { RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ Bool freeSrcClip = FALSE; @@ -364,14 +348,7 @@ afbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, } RegionPtr -afbCopyPlane(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, - dstx, dsty, plane) -DrawablePtr pSrcDrawable, pDstDrawable; -register GC *pGC; -int srcx, srcy; -int width, height; -int dstx, dsty; -unsigned long plane; +afbCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, register GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, long unsigned int plane) { int alu; RegionPtr prgnExposed = NULL; @@ -452,12 +429,7 @@ unsigned long plane; } void -afbCopy1ToN(pSrc, pDst, alu, prgnDst, pptSrc, planemask) - DrawablePtr pSrc, pDst; - int alu; - RegionPtr prgnDst; - DDXPointPtr pptSrc; - unsigned long planemask; +afbCopy1ToN(DrawablePtr pSrc, DrawablePtr pDst, int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, long unsigned int planemask) { int numRects = REGION_NUM_RECTS(prgnDst); BoxPtr pbox = REGION_RECTS(prgnDst); diff --git a/afb/afbblt.c b/afb/afbblt.c index 6cbb0a878..9eb0227f2 100644 --- a/afb/afbblt.c +++ b/afb/afbblt.c @@ -37,6 +37,8 @@ Author: Keith Packard #include <dix-config.h> #endif +#include <stdlib.h> + #include <X11/X.h> #include <X11/Xmd.h> #include <X11/Xproto.h> diff --git a/afb/afbclip.c b/afb/afbclip.c index ea7413233..89314f134 100644 --- a/afb/afbclip.c +++ b/afb/afbclip.c @@ -52,6 +52,8 @@ SOFTWARE. #include <dix-config.h> #endif +#include <stdlib.h> + #include <X11/X.h> #include "regionstr.h" #include "pixmapstr.h" diff --git a/afb/afbcmap.c b/afb/afbcmap.c index 69b5d7ca4..5043d97a6 100644 --- a/afb/afbcmap.c +++ b/afb/afbcmap.c @@ -39,66 +39,53 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "colormapst.h" #include "resource.h" #include "micmap.h" +#include "afb.h" int -afbListInstalledColormaps(pScreen, pmaps) - ScreenPtr pScreen; - Colormap *pmaps; +afbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) { return miListInstalledColormaps(pScreen, pmaps); } void -afbInstallColormap(pmap) - ColormapPtr pmap; +afbInstallColormap(ColormapPtr pmap) { miInstallColormap(pmap); } void -afbUninstallColormap(pmap) - ColormapPtr pmap; +afbUninstallColormap(ColormapPtr pmap) { miUninstallColormap(pmap); } void -afbResolveColor(pred, pgreen, pblue, pVisual) - unsigned short *pred, *pgreen, *pblue; - register VisualPtr pVisual; +afbResolveColor(short unsigned int *pred, short unsigned int *pgreen, short unsigned int *pblue, register VisualPtr pVisual) { miResolveColor(pred, pgreen, pblue, pVisual); } Bool -afbInitializeColormap(pmap) - register ColormapPtr pmap; +afbInitializeColormap(register ColormapPtr pmap) { return miInitializeColormap(pmap); } int -afbExpandDirectColors(pmap, ndef, indefs, outdefs) - ColormapPtr pmap; - int ndef; - xColorItem *indefs, *outdefs; +afbExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs, xColorItem *outdefs) { return miExpandDirectColors(pmap, ndef, indefs, outdefs); } Bool -afbCreateDefColormap(pScreen) - ScreenPtr pScreen; +afbCreateDefColormap(ScreenPtr pScreen) { return miCreateDefColormap(pScreen); } Bool -afbSetVisualTypes(depth, visuals, bitsPerRGB) - int depth; - int visuals; - int bitsPerRGB; +afbSetVisualTypes(int depth, int visuals, int bitsPerRGB) { return miSetVisualTypes(depth, visuals, bitsPerRGB, -1); } @@ -110,15 +97,7 @@ afbSetVisualTypes(depth, visuals, bitsPerRGB) */ Bool -afbInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp, - sizes, bitsPerRGB) - VisualPtr *visualp; - DepthPtr *depthp; - int *nvisualp, *ndepthp; - int *rootDepthp; - VisualID *defaultVisp; - unsigned long sizes; - int bitsPerRGB; +afbInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, int *ndepthp, int *rootDepthp, VisualID *defaultVisp, long unsigned int sizes, int bitsPerRGB) { return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp, sizes, bitsPerRGB, -1); diff --git a/afb/afbfillarc.c b/afb/afbfillarc.c index 17b4902d9..30e0bd3a5 100644 --- a/afb/afbfillarc.c +++ b/afb/afbfillarc.c @@ -44,10 +44,7 @@ in this Software without prior written authorization from the X Consortium. #include "mi.h" static void -afbFillEllipseSolid(pDraw, arc, rrops) - DrawablePtr pDraw; - xArc *arc; - register unsigned char *rrops; +afbFillEllipseSolid(DrawablePtr pDraw, xArc *arc, register unsigned char *rrops) { int x, y, e; int yk, xk, ym, xm, dx, dy, xorg, yorg; @@ -268,11 +265,7 @@ afbFillEllipseSolid(pDraw, arc, rrops) } static void -afbFillArcSliceSolidCopy(pDraw, pGC, arc, rrops) - DrawablePtr pDraw; - GCPtr pGC; - xArc *arc; - register unsigned char *rrops; +afbFillArcSliceSolidCopy(DrawablePtr pDraw, GCPtr pGC, xArc *arc, register unsigned char *rrops) { PixelType *addrl; register PixelType *pdst; @@ -321,11 +314,7 @@ afbFillArcSliceSolidCopy(pDraw, pGC, arc, rrops) } void -afbPolyFillArcSolid(pDraw, pGC, narcs, parcs) - register DrawablePtr pDraw; - GCPtr pGC; - int narcs; - xArc *parcs; +afbPolyFillArcSolid(register DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) { afbPrivGC *priv; register xArc *arc; diff --git a/afb/afbfillrct.c b/afb/afbfillrct.c index 3646d78c6..ed2e6031e 100644 --- a/afb/afbfillrct.c +++ b/afb/afbfillrct.c @@ -65,7 +65,6 @@ SOFTWARE. #include "maskbits.h" #define MODEQ(a, b) ((a) %= (b)) -void afbPaintOddSize(); /* filled rectangles. @@ -76,11 +75,11 @@ helper function in the GC. #define NUM_STACK_RECTS 1024 void -afbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) - DrawablePtr pDrawable; - GCPtr pGC; - int nrectFill; /* number of rectangles to fill */ - xRectangle *prectInit; /* Pointer to first rectangle to fill */ +afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit) + + + /* number of rectangles to fill */ + /* Pointer to first rectangle to fill */ { xRectangle *prect; RegionPtr prgnClip; diff --git a/afb/afbgc.c b/afb/afbgc.c index e9f4c52b7..14c95c754 100644 --- a/afb/afbgc.c +++ b/afb/afbgc.c @@ -52,6 +52,8 @@ SOFTWARE. #include <dix-config.h> #endif +#include <string.h> + #include <X11/X.h> #include <X11/Xmd.h> #include <X11/Xproto.h> diff --git a/afb/afbimage.c b/afb/afbimage.c index 353fd6f89..a0b4270e8 100644 --- a/afb/afbimage.c +++ b/afb/afbimage.c @@ -4,6 +4,8 @@ #include <dix-config.h> #endif +#include <string.h> + #include <X11/X.h> #include "windowstr.h" #include "pixmapstr.h" diff --git a/afb/afbline.c b/afb/afbline.c index 255ea21c1..d3f2def89 100644 --- a/afb/afbline.c +++ b/afb/afbline.c @@ -53,6 +53,7 @@ SOFTWARE. #endif #include <X11/X.h> +#include <stdlib.h> #include "gcstruct.h" #include "windowstr.h" diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c index c6ae8481c..72482ff7f 100644 --- a/afb/afbpixmap.c +++ b/afb/afbpixmap.c @@ -58,6 +58,8 @@ SOFTWARE. #include <dix-config.h> #endif +#include <string.h> + #include <X11/Xmd.h> #include "scrnintstr.h" #include "pixmapstr.h" diff --git a/afb/afbply1rct.c b/afb/afbply1rct.c index 90e55cf8e..b7a16e086 100644 --- a/afb/afbply1rct.c +++ b/afb/afbply1rct.c @@ -32,6 +32,8 @@ in this Software without prior written authorization from the X Consortium. #include <dix-config.h> #endif +#include <stdlib.h> + #include <X11/X.h> #include "gcstruct.h" diff --git a/afb/afbpushpxl.c b/afb/afbpushpxl.c index e62181188..c717f0e45 100644 --- a/afb/afbpushpxl.c +++ b/afb/afbpushpxl.c @@ -52,6 +52,8 @@ SOFTWARE. #include <dix-config.h> #endif +#include <string.h> + #include <X11/X.h> #include "gcstruct.h" #include "scrnintstr.h" @@ -60,92 +62,6 @@ SOFTWARE. #include "maskbits.h" #include "afb.h" -/* afbSolidPP is courtesy of xhacks@csri.toronto.edu - - For fillStyle==FillSolid, a monochrome PushPixels can be reduced to - a ROP in the following way: (Note that the ROP is the same as the - result of ROP(src=0x3,dst=0x5)) - - src=0011 0000 0011 - dst=0101 0101 0101 - rop fg=0 fg=1 - GXclear 0x0 0000 0100 0100 0 - GXand 0x1 0001 0100 0101 s&d - GXandReverse 0x2 0010 0100 0110 s&~d - GXcopy 0x3 0011 0100 0111 s - GXandInverted 0x4 0100 0101 0100 ~s&d - GXnoop 0x5 0101 0101 0101 d - GXxor 0x6 0110 0101 0110 s^d - GXor 0x7 0111 0101 0111 s|d - GXnor 0x8 1000 0110 0100 ~s&~d - GXequiv 0x9 1001 0110 0101 ~s^d - GXinvert 0xa 1010 0110 0110 ~d - GXorReverse 0xb 1011 0110 0111 s|~d - GXcopyInverted 0xc 1100 0111 0100 ~s - GXorInverted 0xd 1101 0111 0101 ~s|d - GXnand 0xe 1110 0111 0110 ~s|~d - GXset 0xf 1111 0111 0111 1 - -For src=0: newRop = 0x4|(rop>>2) -For src=1: newRop = 0x4|(rop&3) -*/ - -/* afbSolidPP -- squeegees the forground color of pGC through pBitMap - * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may - * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit - * is set in the bitmap, the fill style is put onto the drawable using - * the GC's logical function. The drawable is not changed where the bitmap - * has a zero bit or outside the area covered by the stencil. - */ -void -afbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) - GCPtr pGC; - PixmapPtr pBitMap; - DrawablePtr pDrawable; - int dx, dy, xOrg, yOrg; -{ - unsigned char alu; - RegionRec rgnDst; - DDXPointPtr pptSrc; - BoxRec srcBox; - register DDXPointPtr ppt; - register BoxPtr pbox; - int i; - - if (!pGC->planemask & 1) return; - - /* compute the reduced rop function */ - alu = pGC->alu; - if (!(pGC->fgPixel&1)) alu >>= 2; - alu = (alu & 0x3) | 0x4; - if (alu == GXnoop) return; - - srcBox.x1 = xOrg; - srcBox.y1 = yOrg; - srcBox.x2 = xOrg + dx; - srcBox.y2 = yOrg + dy; - REGION_INIT(pGC->pScreen, &rgnDst, &srcBox, 1); - - /* clip the shape of the dst to the destination composite clip */ - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip); - - if (!REGION_NIL(&rgnDst)) { - i = REGION_NUM_RECTS(&rgnDst); - pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec)); - if(pptSrc) { - for (pbox = REGION_RECTS(&rgnDst), ppt = pptSrc; --i >= 0; - pbox++, ppt++) { - ppt->x = pbox->x1 - xOrg; - ppt->y = pbox->y1 - yOrg; - } - afbDoBitblt((DrawablePtr)pBitMap, pDrawable, alu, &rgnDst, pptSrc, - pGC->planemask); - DEALLOCATE_LOCAL(pptSrc); - } - } - REGION_UNINIT(pGC->pScreen, &rgnDst); -} - #define NPT 128 /* afbPushPixels -- squeegees the forground color of pGC through pBitMap @@ -156,11 +72,7 @@ afbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) * has a zero bit or outside the area covered by the stencil. */ void -afbPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) - GCPtr pGC; - PixmapPtr pBitMap; - DrawablePtr pDrawable; - int dx, dy, xOrg, yOrg; +afbPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg) { int h, dxDivPPW, ibEnd; PixelType *pwLineStart; diff --git a/afb/afbscrinit.c b/afb/afbscrinit.c index 2e10ad885..b9e0ba94f 100644 --- a/afb/afbscrinit.c +++ b/afb/afbscrinit.c @@ -52,6 +52,8 @@ SOFTWARE. #include <dix-config.h> #endif +#include <stdlib.h> + #include <X11/X.h> #include <X11/Xproto.h> /* for xColorItem */ #include <X11/Xmd.h> @@ -86,9 +88,7 @@ BSFuncRec afbBSFuncRec = { }; Bool -afbCloseScreen(index, pScreen) - int index; - ScreenPtr pScreen; +afbCloseScreen(int index, ScreenPtr pScreen) { int d; DepthPtr depths = pScreen->allowedDepths; @@ -101,9 +101,8 @@ afbCloseScreen(index, pScreen) return(TRUE); } -Bool -afbCreateScreenResources(pScreen) - ScreenPtr pScreen; +static Bool +afbCreateScreenResources(ScreenPtr pScreen) { Bool retval; @@ -123,9 +122,7 @@ afbCreateScreenResources(pScreen) } Bool -afbAllocatePrivates(pScreen, pWinIndex, pGCIndex) - ScreenPtr pScreen; - int *pWinIndex, *pGCIndex; +afbAllocatePrivates(ScreenPtr pScreen, int *pWinIndex, int *pGCIndex) { if (afbGeneration != serverGeneration) { #ifdef PIXMAP_PER_WINDOW @@ -149,12 +146,12 @@ afbAllocatePrivates(pScreen, pWinIndex, pGCIndex) /* dts * (inch/dot) * (25.4 mm / inch) = mm */ Bool -afbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ +afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, int dpix, int dpiy, int width) + + /* pointer to screen bitmap */ + /* in pixels */ + /* dots per inch */ + /* pixel width of frame buffer */ { VisualPtr visuals; DepthPtr depths; @@ -198,11 +195,11 @@ afbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->UnrealizeFont = afbUnrealizeFont; pScreen->CreateGC = afbCreateGC; pScreen->CreateColormap = afbInitializeColormap; - pScreen->DestroyColormap = (void (*)())NoopDDA; + pScreen->DestroyColormap = (DestroyColormapProcPtr)NoopDDA; pScreen->InstallColormap = afbInstallColormap; pScreen->UninstallColormap = afbUninstallColormap; pScreen->ListInstalledColormaps = afbListInstalledColormaps; - pScreen->StoreColors = (void (*)())NoopDDA; + pScreen->StoreColors = (StoreColorsProcPtr)NoopDDA; pScreen->ResolveColor = afbResolveColor; pScreen->BitmapToRegion = afbPixmapToRegion; oldDevPrivate = pScreen->devPrivate; @@ -223,8 +220,7 @@ afbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) } PixmapPtr -afbGetWindowPixmap(pWin) - WindowPtr pWin; +afbGetWindowPixmap(WindowPtr pWin) { #ifdef PIXMAP_PER_WINDOW return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr); @@ -236,9 +232,7 @@ afbGetWindowPixmap(pWin) } void -afbSetWindowPixmap(pWin, pPix) - WindowPtr pWin; - PixmapPtr pPix; +afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix) { #ifdef PIXMAP_PER_WINDOW pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix; diff --git a/afb/afbwindow.c b/afb/afbwindow.c index 443dd5aed..90a4f7dfe 100644 --- a/afb/afbwindow.c +++ b/afb/afbwindow.c @@ -53,6 +53,8 @@ SOFTWARE. #include <dix-config.h> #endif +#include <stdlib.h> + #include <X11/X.h> #include "scrnintstr.h" #include "windowstr.h" diff --git a/afb/afbzerarc.c b/afb/afbzerarc.c index ef62238db..0fe9244ad 100644 --- a/afb/afbzerarc.c +++ b/afb/afbzerarc.c @@ -83,10 +83,7 @@ in this Software without prior written authorization from the X Consortium. #define DoPix(bit,base,yoff,xoff) if (mask & bit) Pixelate(base,yoff,xoff); static void -afbZeroArcSS(pDraw, pGC, arc) - DrawablePtr pDraw; - GCPtr pGC; - xArc *arc; +afbZeroArcSS(DrawablePtr pDraw, GCPtr pGC, xArc *arc) { miZeroArcRec info; Bool do360; @@ -182,11 +179,7 @@ afbZeroArcSS(pDraw, pGC, arc) } void -afbZeroPolyArcSS(pDraw, pGC, narcs, parcs) - DrawablePtr pDraw; - GCPtr pGC; - int narcs; - xArc *parcs; +afbZeroPolyArcSS(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) { register xArc *arc; register int i; |