xc/programs/Xserver/afb/afbbres.c
xc/programs/Xserver/afb/afbbresd.c xc/programs/Xserver/afb/afbclip.c xc/programs/Xserver/afb/afbhrzvert.c xc/programs/Xserver/afb/afbline.c xc/programs/Xserver/afb/afbmodule.c xc/programs/Xserver/afb/afbpixmap.c xc/programs/Xserver/afb/afbpolypnt.c xc/programs/Xserver/afb/afbpushpxl.c xc/programs/Xserver/afb/afbtegblt.c xc/programs/Xserver/cfb/Imakefile.inc xc/programs/Xserver/cfb/cfballpriv.c xc/programs/Xserver/cfb/cfbbitblt.c xc/programs/Xserver/cfb/cfbcppl.c xc/programs/Xserver/cfb/cfbgc.c xc/programs/Xserver/cfb/cfbglblt8.c xc/programs/Xserver/cfb/cfbmap.h xc/programs/Xserver/cfb/cfbpixmap.c xc/programs/Xserver/cfb/cfbscrinit.c xc/programs/Xserver/cfb/cfbtab.h xc/programs/Xserver/cfb/cfbteblt8.c xc/programs/Xserver/cfb/cfbunmap.h xc/programs/Xserver/mfb/maskbits.c xc/programs/Xserver/mfb/maskbits.h xc/programs/Xserver/mfb/mergerop.h xc/programs/Xserver/mfb/mfb.h xc/programs/Xserver/mfb/mfbclip.c xc/programs/Xserver/mfb/mfbfont.c xc/programs/Xserver/mfb/mfbgc.c xc/programs/Xserver/mfb/mfbmisc.c xc/programs/Xserver/mfb/mfbpushpxl.c //bugs.freedesktop.org/show_bug.cgi?id=1114) attachment #667 (https://bugs.freedesktop.org/attachment.cgi?id=667): Convert afb and cfb{,16,24,32} to be dlloader-friendly. Patch by Adam Jackson <ajax@freedesktop.org>.
This commit is contained in:
@@ -42,7 +42,7 @@ in this Software without prior written authorization from The Open Group.
|
||||
#include "cfbmskbits.h"
|
||||
#include "mibstore.h"
|
||||
|
||||
#if PSZ==8
|
||||
#if 1 || PSZ==8
|
||||
int cfbWindowPrivateIndex;
|
||||
int cfbGCPrivateIndex;
|
||||
#endif
|
||||
|
||||
@@ -973,15 +973,15 @@ cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
|
||||
#else /* PSZ == 8 */
|
||||
|
||||
#define mfbmaskbits(x, w, startmask, endmask, nlw) \
|
||||
startmask = starttab[(x)&0x1f]; \
|
||||
endmask = endtab[((x)+(w)) & 0x1f]; \
|
||||
startmask = mfbGetstarttab((x)&0x1f); \
|
||||
endmask = mfbGetendtab(((x)+(w)) & 0x1f); \
|
||||
if (startmask) \
|
||||
nlw = (((w) - (32 - ((x)&0x1f))) >> 5); \
|
||||
else \
|
||||
nlw = (w) >> 5;
|
||||
|
||||
#define mfbmaskpartialbits(x, w, mask) \
|
||||
mask = partmasks[(x)&0x1f][(w)&0x1f];
|
||||
mask = mfbGetpartmasks((x)&0x1f,(w)&0x1f);
|
||||
|
||||
#define LeftMost 0
|
||||
#define StepBit(bit, inc) ((bit) += (inc))
|
||||
@@ -1389,7 +1389,7 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
|
||||
|
||||
oldalu = pGC->alu;
|
||||
if ((pGC->fgPixel & 1) == 0 && (pGC->bgPixel&1) == 1)
|
||||
pGC->alu = InverseAlu[pGC->alu];
|
||||
pGC->alu = mfbGetInverseAlu(pGC->alu);
|
||||
else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1))
|
||||
pGC->alu = mfbReduceRop(pGC->alu, pGC->fgPixel);
|
||||
ret = cfbCopyPlaneReduce(pSrcDrawable, pDstDrawable,
|
||||
|
||||
@@ -245,15 +245,15 @@ cfbCopyPlane8to1(
|
||||
#else /* PSZ == 8 */
|
||||
|
||||
#define mfbmaskbits(x, w, startmask, endmask, nlw) \
|
||||
startmask = starttab[(x)&0x1f]; \
|
||||
endmask = endtab[((x)+(w)) & 0x1f]; \
|
||||
startmask = mfbGetstarttab((x)&0x1f); \
|
||||
endmask = mfbGetendtab(((x)+(w)) & 0x1f); \
|
||||
if (startmask) \
|
||||
nlw = (((w) - (32 - ((x)&0x1f))) >> 5); \
|
||||
else \
|
||||
nlw = (w) >> 5;
|
||||
|
||||
#define mfbmaskpartialbits(x, w, mask) \
|
||||
mask = partmasks[(x)&0x1f][(w)&0x1f];
|
||||
mask = mfbGetpartmasks((x)&0x1f,(w)&0x1f);
|
||||
|
||||
#define LeftMost 0
|
||||
#define StepBit(bit, inc) ((bit) += (inc))
|
||||
|
||||
28
cfb/cfbgc.c
28
cfb/cfbgc.c
@@ -85,11 +85,13 @@ SOFTWARE.
|
||||
# define usePolyGlyphBlt miPolyGlyphBlt
|
||||
#endif
|
||||
|
||||
void cfbUnPushPixels (GCPtr, PixmapPtr, DrawablePtr, int, int, int, int);
|
||||
|
||||
#ifdef FOUR_BIT_CODE
|
||||
# define usePushPixels cfbPushPixels8
|
||||
#else
|
||||
#ifndef LOWMEMFTPT
|
||||
# define usePushPixels mfbPushPixels
|
||||
# define usePushPixels cfbUnPushPixels
|
||||
#else
|
||||
# define usePushPixels miPushPixels
|
||||
#endif /* ifndef LOWMEMFTPT */
|
||||
@@ -284,6 +286,14 @@ cfbCreateGC(pGC)
|
||||
pGC->clientClip = NULL;
|
||||
pGC->clientClipType = CT_NONE;
|
||||
|
||||
if (cfbNonTEOps.PushPixels == cfbUnPushPixels)
|
||||
{
|
||||
cfbTEOps1Rect.PushPixels = mfbPushPixelsWeak();
|
||||
cfbNonTEOps1Rect.PushPixels = mfbPushPixelsWeak();
|
||||
cfbTEOps.PushPixels = mfbPushPixelsWeak();
|
||||
cfbNonTEOps.PushPixels = mfbPushPixelsWeak();
|
||||
}
|
||||
|
||||
/*
|
||||
* some of the output primitives aren't really necessary, since they
|
||||
* will be filled in ValidateGC because of dix/CreateGC() setting all
|
||||
@@ -767,7 +777,7 @@ cfbValidateGC(pGC, changes, pDrawable)
|
||||
#endif
|
||||
#ifdef FOUR_BIT_CODE
|
||||
#ifndef LOWMEMFTPT
|
||||
pGC->ops->PushPixels = mfbPushPixels;
|
||||
pGC->ops->PushPixels = mfbPushPixelsWeak();
|
||||
#else
|
||||
pGC->ops->PushPixels = miPushPixels;
|
||||
#endif /* ifndef LOWMEMFTPT */
|
||||
@@ -789,3 +799,17 @@ cfbValidateGC(pGC, changes, pDrawable)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* this is never called, it just exists to have its address
|
||||
* taken in mfbCreateGC.
|
||||
*/
|
||||
static void
|
||||
cfbUnPushPixels (pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg)
|
||||
GCPtr pGC;
|
||||
PixmapPtr pBitmap;
|
||||
DrawablePtr pDrawable;
|
||||
int dx, dy, xOrg, yOrg;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,6 @@ in this Software without prior written authorization from The Open Group.
|
||||
|
||||
#ifdef USE_LEFTBITS
|
||||
typedef unsigned char *glyphPointer;
|
||||
extern CfbBits endtab[];
|
||||
|
||||
#define GlyphBits(bits,width,dst) getleftbits(bits,width,dst); \
|
||||
(dst) &= widthMask; \
|
||||
@@ -251,7 +250,7 @@ cfbPolyGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
#ifdef USE_LEFTBITS
|
||||
w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
|
||||
widthGlyph = PADGLYPHWIDTHBYTES(w);
|
||||
widthMask = endtab[w];
|
||||
widthMask = mfbGetendtab(w);
|
||||
#endif
|
||||
do {
|
||||
dst = dstLine;
|
||||
@@ -380,7 +379,7 @@ cfbPolyGlyphBlt8Clipped(
|
||||
#ifdef USE_LEFTBITS
|
||||
w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
|
||||
widthGlyph = PADGLYPHWIDTHBYTES(w);
|
||||
widthMask = endtab[w];
|
||||
widthMask = mfbGetendtab(w);
|
||||
#endif
|
||||
switch (cfb8ComputeClipMasks32 (pBox, numRects, xG, yG, w, hTmp, clips))
|
||||
{
|
||||
|
||||
14
cfb/cfbmap.h
14
cfb/cfbmap.h
@@ -94,13 +94,17 @@ in this Software without prior written authorization from The Open Group.
|
||||
#undef cfbFillSpanTileOddGeneral
|
||||
#undef cfbFinishScreenInit
|
||||
#undef cfbGCFuncs
|
||||
#undef cfbGCPrivateIndex
|
||||
#undef cfbGetImage
|
||||
#undef cfbGetScreenPixmap
|
||||
#undef cfbGetSpans
|
||||
#undef cfbHorzS
|
||||
#undef cfbImageGlyphBlt8
|
||||
#undef cfbInitializeColormap
|
||||
#undef cfbInstallColormap
|
||||
#undef cfbLineSD
|
||||
#undef cfbLineSS
|
||||
#undef cfbListInstalledColormaps
|
||||
#undef cfbMapWindow
|
||||
#undef cfbMatchCommon
|
||||
#undef cfbNonTEOps
|
||||
@@ -116,6 +120,7 @@ in this Software without prior written authorization from The Open Group.
|
||||
#undef cfbPositionWindow
|
||||
#undef cfbPutImage
|
||||
#undef cfbReduceRasterOp
|
||||
#undef cfbResolveColor
|
||||
#undef cfbRestoreAreas
|
||||
#undef cfbSaveAreas
|
||||
#undef cfbScreenInit
|
||||
@@ -136,11 +141,13 @@ in this Software without prior written authorization from The Open Group.
|
||||
#undef cfbTEOps1Rect
|
||||
#undef cfbTile32FSCopy
|
||||
#undef cfbTile32FSGeneral
|
||||
#undef cfbUninstallColormap
|
||||
#undef cfbUnmapWindow
|
||||
#undef cfbUnnaturalStippleFS
|
||||
#undef cfbUnnaturalTileFS
|
||||
#undef cfbValidateGC
|
||||
#undef cfbVertS
|
||||
#undef cfbWindowPrivateIndex
|
||||
#undef cfbXRotatePixmap
|
||||
#undef cfbYRotatePixmap
|
||||
#undef cfbZeroPolyArcSS8Copy
|
||||
@@ -263,13 +270,17 @@ cfb can not hack PSZ yet
|
||||
#define cfbFillSpanTileOddGeneral CFBNAME(FillSpanTileOddGeneral)
|
||||
#define cfbFinishScreenInit CFBNAME(FinishScreenInit)
|
||||
#define cfbGCFuncs CFBNAME(GCFuncs)
|
||||
#define cfbGCPrivateIndex CFBNAME(GCPrivateIndex)
|
||||
#define cfbGetImage CFBNAME(GetImage)
|
||||
#define cfbGetScreenPixmap CFBNAME(GetScreenPixmap)
|
||||
#define cfbGetSpans CFBNAME(GetSpans)
|
||||
#define cfbHorzS CFBNAME(HorzS)
|
||||
#define cfbImageGlyphBlt8 CFBNAME(ImageGlyphBlt8)
|
||||
#define cfbInitializeColormap CFBNAME(InitializeColormap)
|
||||
#define cfbInstallColormap CFBNAME(InstallColormap)
|
||||
#define cfbLineSD CFBNAME(LineSD)
|
||||
#define cfbLineSS CFBNAME(LineSS)
|
||||
#define cfbListInstalledColormaps CFBNAME(ListInstalledColormaps)
|
||||
#define cfbMapWindow CFBNAME(MapWindow)
|
||||
#define cfbMatchCommon CFBNAME(MatchCommon)
|
||||
#define cfbNonTEOps CFBNAME(NonTEOps)
|
||||
@@ -285,6 +296,7 @@ cfb can not hack PSZ yet
|
||||
#define cfbPositionWindow CFBNAME(PositionWindow)
|
||||
#define cfbPutImage CFBNAME(PutImage)
|
||||
#define cfbReduceRasterOp CFBNAME(ReduceRasterOp)
|
||||
#define cfbResolveColor CFBNAME(ResolveColor)
|
||||
#define cfbRestoreAreas CFBNAME(RestoreAreas)
|
||||
#define cfbSaveAreas CFBNAME(SaveAreas)
|
||||
#define cfbScreenInit CFBNAME(ScreenInit)
|
||||
@@ -305,11 +317,13 @@ cfb can not hack PSZ yet
|
||||
#define cfbTEOps1Rect CFBNAME(TEOps1Rect)
|
||||
#define cfbTile32FSCopy CFBNAME(Tile32FSCopy)
|
||||
#define cfbTile32FSGeneral CFBNAME(Tile32FSGeneral)
|
||||
#define cfbUninstallColormap CFBNAME(UninstallColormap)
|
||||
#define cfbUnmapWindow CFBNAME(UnmapWindow)
|
||||
#define cfbUnnaturalStippleFS CFBNAME(UnnaturalStippleFS)
|
||||
#define cfbUnnaturalTileFS CFBNAME(UnnaturalTileFS)
|
||||
#define cfbValidateGC CFBNAME(ValidateGC)
|
||||
#define cfbVertS CFBNAME(VertS)
|
||||
#define cfbWindowPrivateIndex CFBNAME(WindowPrivateIndex)
|
||||
#define cfbXRotatePixmap CFBNAME(XRotatePixmap)
|
||||
#define cfbYRotatePixmap CFBNAME(YRotatePixmap)
|
||||
#define cfbZeroPolyArcSS8Copy CFBNAME(ZeroPolyArcSSCopy)
|
||||
|
||||
@@ -60,8 +60,6 @@ SOFTWARE.
|
||||
#include "cfb.h"
|
||||
#include "cfbmskbits.h"
|
||||
|
||||
extern CfbBits endtab[];
|
||||
|
||||
PixmapPtr
|
||||
cfbCreatePixmap (pScreen, width, height, depth)
|
||||
ScreenPtr pScreen;
|
||||
@@ -160,7 +158,7 @@ cfbPadPixmap(pPixmap)
|
||||
if (rep*width != PGSZ)
|
||||
return;
|
||||
|
||||
mask = endtab[width];
|
||||
mask = mfbGetendtab(width);
|
||||
|
||||
p = (CfbBits *)(pPixmap->devPrivate.ptr);
|
||||
for (h=0; h < pPixmap->drawable.height; h++)
|
||||
|
||||
@@ -99,7 +99,7 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
|
||||
pScreen->defColormap = FakeClientID(0);
|
||||
/* let CreateDefColormap do whatever it wants for pixels */
|
||||
pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
|
||||
pScreen->QueryBestSize = mfbQueryBestSize;
|
||||
pScreen->QueryBestSize = mfbQueryBestSizeWeak();
|
||||
/* SaveScreen */
|
||||
pScreen->GetImage = cfbGetImage;
|
||||
pScreen->GetSpans = cfbGetSpans;
|
||||
@@ -114,8 +114,8 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
|
||||
pScreen->CopyWindow = cfbCopyWindow;
|
||||
pScreen->CreatePixmap = cfbCreatePixmap;
|
||||
pScreen->DestroyPixmap = cfbDestroyPixmap;
|
||||
pScreen->RealizeFont = mfbRealizeFont;
|
||||
pScreen->UnrealizeFont = mfbUnrealizeFont;
|
||||
pScreen->RealizeFont = mfbRealizeFontWeak();
|
||||
pScreen->UnrealizeFont = mfbUnrealizeFontWeak();
|
||||
pScreen->CreateGC = cfbCreateGC;
|
||||
pScreen->CreateColormap = cfbInitializeColormap;
|
||||
pScreen->DestroyColormap = DestroyColormapNoop;
|
||||
@@ -124,7 +124,7 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
|
||||
pScreen->ListInstalledColormaps = cfbListInstalledColormaps;
|
||||
pScreen->StoreColors = StoreColorsNoop;
|
||||
pScreen->ResolveColor = cfbResolveColor;
|
||||
pScreen->BitmapToRegion = mfbPixmapToRegion;
|
||||
pScreen->BitmapToRegion = mfbPixmapToRegionWeak();
|
||||
|
||||
mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane);
|
||||
return TRUE;
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#define _CFBTAB_H_
|
||||
|
||||
/* prototypes */
|
||||
#if 0
|
||||
extern int starttab[32], endtab[32];
|
||||
extern unsigned int partmasks[32][32];
|
||||
#endif
|
||||
|
||||
#endif /* _CFBTAB_H_ */
|
||||
|
||||
@@ -160,7 +160,6 @@ typedef unsigned int *glyphPointer;
|
||||
#endif
|
||||
|
||||
#ifdef USE_LEFTBITS
|
||||
extern CfbBits endtab[];
|
||||
|
||||
#define IncChar(c) (c = (glyphPointer) (((char *) c) + glyphBytes))
|
||||
|
||||
@@ -408,7 +407,7 @@ CFBTEGBLT8 (pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase)
|
||||
#endif
|
||||
|
||||
#ifdef USE_LEFTBITS
|
||||
glyphMask = endtab[widthGlyph];
|
||||
glyphMask = mfbGetendtab(widthGlyph);
|
||||
glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -93,13 +93,17 @@
|
||||
#undef cfbFillSpanTileOddGeneral
|
||||
#undef cfbFinishScreenInit
|
||||
#undef cfbGCFuncs
|
||||
#undef cfbGCPrivateIndex
|
||||
#undef cfbGetImage
|
||||
#undef cfbGetScreenPixmap
|
||||
#undef cfbGetSpans
|
||||
#undef cfbHorzS
|
||||
#undef cfbImageGlyphBlt8
|
||||
#undef cfbInitializeColormap
|
||||
#undef cfbInstallColormap
|
||||
#undef cfbLineSD
|
||||
#undef cfbLineSS
|
||||
#undef cfbListInstalledColormaps
|
||||
#undef cfbMapWindow
|
||||
#undef cfbMatchCommon
|
||||
#undef cfbNonTEOps
|
||||
@@ -115,6 +119,7 @@
|
||||
#undef cfbPositionWindow
|
||||
#undef cfbPutImage
|
||||
#undef cfbReduceRasterOp
|
||||
#undef cfbResolveColor
|
||||
#undef cfbRestoreAreas
|
||||
#undef cfbSaveAreas
|
||||
#undef cfbScreenInit
|
||||
@@ -135,11 +140,13 @@
|
||||
#undef cfbTEOps1Rect
|
||||
#undef cfbTile32FSCopy
|
||||
#undef cfbTile32FSGeneral
|
||||
#undef cfbUninstallColormap
|
||||
#undef cfbUnmapWindow
|
||||
#undef cfbUnnaturalStippleFS
|
||||
#undef cfbUnnaturalTileFS
|
||||
#undef cfbValidateGC
|
||||
#undef cfbVertS
|
||||
#undef cfbWindowPrivateIndex
|
||||
#undef cfbXRotatePixmap
|
||||
#undef cfbYRotatePixmap
|
||||
#undef cfbZeroPolyArcSS8Copy
|
||||
|
||||
Reference in New Issue
Block a user