merge XFree86 4.3.0.1 to -CURRENT
This commit is contained in:
@@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization
|
||||
from The Open Group.
|
||||
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/mfb/fastblt.h,v 1.5 2001/12/14 20:00:03 dawes Exp $ */
|
||||
|
||||
/*
|
||||
* Fast bitblt macros for certain hardware. If your machine has an addressing
|
||||
@@ -77,7 +78,6 @@ from The Open Group.
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PPW == 32
|
||||
#define DuffL(counter,label,body) \
|
||||
switch (counter & 3) { \
|
||||
label: \
|
||||
@@ -92,27 +92,3 @@ from The Open Group.
|
||||
if ((counter -= 4) >= 0) \
|
||||
goto label; \
|
||||
}
|
||||
#else /* PPW == 64 */
|
||||
#define DuffL(counter,label,body) \
|
||||
switch (counter & 7) { \
|
||||
label: \
|
||||
body \
|
||||
case 7: \
|
||||
body \
|
||||
case 6: \
|
||||
body \
|
||||
case 5: \
|
||||
body \
|
||||
case 4: \
|
||||
body \
|
||||
case 3: \
|
||||
body \
|
||||
case 2: \
|
||||
body \
|
||||
case 1: \
|
||||
body \
|
||||
case 0: \
|
||||
if ((counter -= 8) >= 0) \
|
||||
goto label; \
|
||||
}
|
||||
#endif /* PPW */
|
||||
|
||||
8868
mfb/maskbits.c
8868
mfb/maskbits.c
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/maskbits.h,v 3.9 2003/02/18 21:30:00 tsi Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.1, 1/24/89 */
|
||||
/***********************************************************
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||
@@ -22,6 +23,7 @@ SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
/* $Xorg: maskbits.h,v 1.3 2000/08/17 19:53:34 cpqbld Exp $ */
|
||||
|
||||
#include "X.h"
|
||||
#include "Xmd.h"
|
||||
#include "servermd.h"
|
||||
@@ -196,18 +198,21 @@ getshiftedleftbits(psrc, offset, w, dst)
|
||||
*
|
||||
* The MFB_ versions are here so that cfb can include maskbits.h to get
|
||||
* the bitmap constants without conflicting with its own P* constants.
|
||||
*
|
||||
* Keith Packard (keithp@suse.com):
|
||||
* Note mfb64 is no longer supported; it requires DIX support
|
||||
* for realigning images which costs too much
|
||||
*/
|
||||
|
||||
/* warning: PixelType definition duplicated in mfb.h */
|
||||
#ifndef PixelType
|
||||
#define PixelType unsigned long
|
||||
#define PixelType CARD32
|
||||
#endif /* PixelType */
|
||||
#ifndef MfbBits
|
||||
#define MfbBits CARD32
|
||||
#endif
|
||||
|
||||
#ifdef LONG64
|
||||
#define MFB_PGSZB 8
|
||||
#else
|
||||
#define MFB_PGSZB 4
|
||||
#endif /* LONG64 */
|
||||
#define MFB_PPW (MFB_PGSZB<<3) /* assuming 8 bits per byte */
|
||||
#define MFB_PGSZ MFB_PPW
|
||||
#define MFB_PLST (MFB_PPW-1)
|
||||
@@ -217,10 +222,6 @@ getshiftedleftbits(psrc, offset, w, dst)
|
||||
|
||||
#if MFB_PPW == 32
|
||||
#define MFB_PWSH 5
|
||||
#else
|
||||
#if MFB_PPW == 64
|
||||
#define MFB_PWSH 6
|
||||
#endif /* MFB_PPW == 64 */
|
||||
#endif /* MFB_PPW == 32 */
|
||||
|
||||
extern PixelType starttab[];
|
||||
@@ -241,29 +242,25 @@ extern PixelType mask[];
|
||||
#define BitLeft(b,s) SCRLEFT(b,s)
|
||||
#define BitRight(b,s) SCRRIGHT(b,s)
|
||||
|
||||
#ifdef XFree86Server
|
||||
#define LONG2CHARSSAMEORDER(x) ((MfbBits)(x))
|
||||
#define LONG2CHARSDIFFORDER( x ) ( ( ( ( x ) & (MfbBits)0x000000FF ) << 0x18 ) \
|
||||
| ( ( ( x ) & (MfbBits)0x0000FF00 ) << 0x08 ) \
|
||||
| ( ( ( x ) & (MfbBits)0x00FF0000 ) >> 0x08 ) \
|
||||
| ( ( ( x ) & (MfbBits)0xFF000000 ) >> 0x18 ) )
|
||||
#endif /* XFree86Server */
|
||||
|
||||
#if (BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER)
|
||||
#define LONG2CHARS(x) (x)
|
||||
#define LONG2CHARS(x) ((MfbBits)(x))
|
||||
#else
|
||||
/*
|
||||
* the unsigned case below is for compilers like
|
||||
* the Danbury C and i386cc
|
||||
*/
|
||||
#if PPW == 32
|
||||
#define LONG2CHARS( x ) ( ( ( ( x ) & 0x000000FF ) << 0x18 ) \
|
||||
| ( ( ( x ) & 0x0000FF00 ) << 0x08 ) \
|
||||
| ( ( ( x ) & 0x00FF0000 ) >> 0x08 ) \
|
||||
| ( ( ( x ) & (unsigned long)0xFF000000 ) >> 0x18 ) )
|
||||
#else /* PPW == 64 */
|
||||
#define LONG2CHARS( x ) \
|
||||
( ( ( ( x ) & 0x000000FF) << 0x18 ) \
|
||||
| ( ( ( x ) & 0x0000FF00) << 0x08 ) \
|
||||
| ( ( ( x ) & 0x00FF0000) >> 0x08 ) \
|
||||
| ( ( ( x ) & (unsigned long)0xFF000000) >> 0x18 ) \
|
||||
| ( ( ( x ) & 0x000000FF00000000) << 0x18 ) \
|
||||
| ( ( ( x ) & 0x0000FF0000000000) << 0x08 ) \
|
||||
| ( ( ( x ) & 0x00FF000000000000) >> 0x08 ) \
|
||||
| ( ( ( x ) & (unsigned long)0xFF00000000000000) >> 0x18 ) )
|
||||
#endif /* PPW */
|
||||
#define LONG2CHARS( x ) ( ( ( ( x ) & (MfbBits)0x000000FF ) << 0x18 ) \
|
||||
| ( ( ( x ) & (MfbBits)0x0000FF00 ) << 0x08 ) \
|
||||
| ( ( ( x ) & (MfbBits)0x00FF0000 ) >> 0x08 ) \
|
||||
| ( ( ( x ) & (MfbBits)0xFF000000 ) >> 0x18 ) )
|
||||
#endif /* BITMAP_BIT_ORDER */
|
||||
|
||||
#ifdef STRICT_ANSI_SHIFT
|
||||
@@ -288,7 +285,6 @@ extern PixelType mask[];
|
||||
((alu) == RROP_INVERT) ? ((dst) ^ (src)) : \
|
||||
(dst))
|
||||
|
||||
#if PPW == 32
|
||||
/* A generalized form of a x4 Duff's Device */
|
||||
#define Duff(counter, block) { \
|
||||
while (counter >= 4) {\
|
||||
@@ -306,34 +302,6 @@ extern PixelType mask[];
|
||||
counter = 0; \
|
||||
} \
|
||||
}
|
||||
#else /* PPW == 64 */
|
||||
/* A generalized form of a x8 Duff's Device */
|
||||
#define Duff(counter, block) { \
|
||||
while (counter >= 8) {\
|
||||
{ block; } \
|
||||
{ block; } \
|
||||
{ block; } \
|
||||
{ block; } \
|
||||
{ block; } \
|
||||
{ block; } \
|
||||
{ block; } \
|
||||
{ block; } \
|
||||
counter -= 8; \
|
||||
} \
|
||||
switch (counter & 7) { \
|
||||
case 7: { block; } \
|
||||
case 6: { block; } \
|
||||
case 5: { block; } \
|
||||
case 4: { block; } \
|
||||
case 3: { block; } \
|
||||
case 2: { block; } \
|
||||
case 1: { block; } \
|
||||
case 0: \
|
||||
counter = 0; \
|
||||
} \
|
||||
}
|
||||
#endif /* PPW */
|
||||
|
||||
|
||||
#define maskbits(x, w, startmask, endmask, nlw) \
|
||||
startmask = starttab[(x) & PIM]; \
|
||||
@@ -420,9 +388,10 @@ extern PixelType mask[];
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
register int d = PPW-(x); \
|
||||
*(pdst) = (*(pdst) & endtab[x]) | (SCRRIGHT((src), x)); \
|
||||
(pdst)[1] = ((pdst)[1] & starttab[n]) | \
|
||||
(SCRLEFT(src, PPW-(x)) & endtab[n]); \
|
||||
(SCRLEFT(src, d) & endtab[n]); \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -554,7 +523,7 @@ extern PixelType mask[];
|
||||
#endif
|
||||
|
||||
#if GETLEFTBITS_ALIGNMENT == 1
|
||||
#define getleftbits(psrc, w, dst) dst = *((CARD32 *) psrc)
|
||||
#define getleftbits(psrc, w, dst) dst = *((CARD32 *)(pointer) psrc)
|
||||
#endif /* GETLEFTBITS_ALIGNMENT == 1 */
|
||||
|
||||
#if GETLEFTBITS_ALIGNMENT == 2
|
||||
@@ -588,7 +557,7 @@ extern PixelType mask[];
|
||||
* getbits and putbits, but they work if used together.
|
||||
*
|
||||
* On a MSBFirst machine, a cpu bitfield extract instruction (like bfextu)
|
||||
* could normally assign its result to a long word register in the screen
|
||||
* could normally assign its result to a 32-bit word register in the screen
|
||||
* right position. This saves canceling register shifts by not fighting the
|
||||
* natural cpu byte order.
|
||||
*
|
||||
|
||||
247
mfb/mergerop.h
247
mfb/mergerop.h
@@ -25,6 +25,7 @@ in this Software without prior written authorization from The Open Group.
|
||||
*
|
||||
* Author: Keith Packard, MIT X Consortium
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mergerop.h,v 3.14 2001/12/14 20:00:03 dawes Exp $ */
|
||||
|
||||
#ifndef _MERGEROP_H_
|
||||
#define _MERGEROP_H_
|
||||
@@ -34,17 +35,28 @@ in this Software without prior written authorization from The Open Group.
|
||||
#endif
|
||||
|
||||
typedef struct _mergeRopBits {
|
||||
unsigned long ca1, cx1, ca2, cx2;
|
||||
MfbBits ca1, cx1, ca2, cx2;
|
||||
} mergeRopRec, *mergeRopPtr;
|
||||
|
||||
extern mergeRopRec mergeRopBits[16];
|
||||
|
||||
#define DeclareMergeRop() unsigned long _ca1, _cx1, _ca2, _cx2;
|
||||
#define DeclarePrebuiltMergeRop() unsigned long _cca, _ccx;
|
||||
#if defined(PPW) && defined(PGSZ) && (PPW != PGSZ) /* cfb */
|
||||
#define DeclareMergeRop() MfbBits _ca1 = 0, _cx1 = 0, _ca2 = 0, _cx2 = 0;
|
||||
#define DeclarePrebuiltMergeRop() MfbBits _cca, _ccx;
|
||||
#if PSZ == 24 /* both for PGSZ == 32 and 64 */
|
||||
#define DeclareMergeRop24() \
|
||||
MfbBits _ca1u[4], _cx1u[4], _ca2u[4], _cx2u[4];
|
||||
/* int _unrollidx[3]={0,0,1,2};*/
|
||||
#define DeclarePrebuiltMergeRop24() MfbBits _ccau[4], _ccxu[4];
|
||||
#endif /* PSZ == 24 */
|
||||
#else /* mfb */
|
||||
#define DeclareMergeRop() MfbBits _ca1 = 0, _cx1 = 0, _ca2 = 0, _cx2 = 0;
|
||||
#define DeclarePrebuiltMergeRop() MfbBits _cca, _ccx;
|
||||
#endif
|
||||
|
||||
#if PPW != PGSZ /* cfb */
|
||||
#if defined(PPW) && defined(PGSZ) && (PPW != PGSZ) /* cfb */
|
||||
#define InitializeMergeRop(alu,pm) {\
|
||||
unsigned long _pm; \
|
||||
MfbBits _pm; \
|
||||
mergeRopPtr _bits; \
|
||||
_pm = PFILL(pm); \
|
||||
_bits = &mergeRopBits[alu]; \
|
||||
@@ -53,6 +65,49 @@ extern mergeRopRec mergeRopBits[16];
|
||||
_ca2 = _bits->ca2 & _pm; \
|
||||
_cx2 = _bits->cx2 & _pm; \
|
||||
}
|
||||
#if PSZ == 24
|
||||
#if (BITMAP_BIT_ORDER == MSBFirst)
|
||||
#define InitializeMergeRop24(alu,pm) {\
|
||||
register int i; \
|
||||
register MfbBits _pm = (pm) & 0xFFFFFF; \
|
||||
mergeRopPtr _bits = &mergeRopBits[alu]; \
|
||||
MfbBits _bits_ca1 = _bits->ca1; \
|
||||
MfbBits _bits_cx1 = _bits->cx1; \
|
||||
MfbBits _bits_ca2 = _bits->ca2; \
|
||||
MfbBits _bits_cx2 = _bits->cx2; \
|
||||
_pm = (_pm << 8) | (_pm >> 16); \
|
||||
for(i = 0; i < 4; i++){ \
|
||||
_ca1u[i] = _bits_ca1 & _pm; \
|
||||
_cx1u[i] = _bits_cx1 | ~_pm; \
|
||||
_ca2u[i] = _bits_ca2 & _pm; \
|
||||
_cx2u[i] = _bits_cx2 & _pm; \
|
||||
_pm = (_pm << 16)|(_pm >> 8); \
|
||||
} \
|
||||
}
|
||||
#else /*(BITMAP_BIT_ORDER == LSBFirst)*/
|
||||
#define InitializeMergeRop24(alu,pm) {\
|
||||
register int i; \
|
||||
register MfbBits _pm = (pm) & cfbmask[0]; \
|
||||
mergeRopPtr _bits = &mergeRopBits[alu]; \
|
||||
MfbBits _bits_ca1 = _bits->ca1 & cfbmask[0]; \
|
||||
MfbBits _bits_cx1 = _bits->cx1 & cfbmask[0]; \
|
||||
MfbBits _bits_ca2 = _bits->ca2 & cfbmask[0]; \
|
||||
MfbBits _bits_cx2 = _bits->cx2 & cfbmask[0]; \
|
||||
_pm |= (_pm << 24); \
|
||||
_bits_ca1 |= (_bits->ca1 << 24); \
|
||||
_bits_cx1 |= (_bits->cx1 << 24); \
|
||||
_bits_ca2 |= (_bits->ca2 << 24); \
|
||||
_bits_cx2 |= (_bits->cx2 << 24); \
|
||||
for(i = 0; i < 4; i++){ \
|
||||
_ca1u[i] = _bits_ca1 & _pm; \
|
||||
_cx1u[i] = _bits_cx1 | ~_pm; \
|
||||
_ca2u[i] = _bits_ca2 & _pm; \
|
||||
_cx2u[i] = _bits_cx2 & _pm; \
|
||||
_pm = (_pm << 16)|(_pm >> 8); \
|
||||
} \
|
||||
}
|
||||
#endif /*(BITMAP_BIT_ORDER == MSBFirst)*/
|
||||
#endif /* PSZ == 24 */
|
||||
#else /* mfb */
|
||||
#define InitializeMergeRop(alu,pm) {\
|
||||
mergeRopPtr _bits; \
|
||||
@@ -67,18 +122,69 @@ extern mergeRopRec mergeRopBits[16];
|
||||
/* AND has higher precedence than XOR */
|
||||
|
||||
#define DoMergeRop(src, dst) \
|
||||
((dst) & ((src) & _ca1 ^ _cx1) ^ ((src) & _ca2 ^ _cx2))
|
||||
(((dst) & (((src) & _ca1) ^ _cx1)) ^ (((src) & _ca2) ^ _cx2))
|
||||
|
||||
#define DoPrebuiltMergeRop(dst) ((dst) & _cca ^ _ccx)
|
||||
#define DoMergeRop24u(src, dst, i) \
|
||||
(((dst) & (((src) & _ca1u[i]) ^ _cx1u[i])) ^ (((src) & _ca2u[i]) ^ _cx2u[i]))
|
||||
|
||||
#define DoMaskPrebuiltMergeRop(dst,mask) \
|
||||
((dst) & (_cca | ~(mask)) ^ (_ccx & (mask)))
|
||||
|
||||
#define PrebuildMergeRop(src) ((_cca = (src) & _ca1 ^ _cx1), \
|
||||
(_ccx = (src) & _ca2 ^ _cx2))
|
||||
#define DoMaskMergeRop24(src, dst, mask, index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
MfbBits _src0 = (src);\
|
||||
MfbBits _src1 = (_src0 & _ca1) ^ _cx1; \
|
||||
MfbBits _src2 = (_src0 & _ca2) ^ _cx2; \
|
||||
*(dst) = (((*(dst)) & cfbrmask[idx]) | (((*(dst)) & cfbmask[idx]) & \
|
||||
(((( _src1 |(~mask))<<cfb24Shift[idx])&cfbmask[idx]) ^ \
|
||||
((( _src2&(mask))<<cfb24Shift[idx])&cfbmask[idx])))); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) = (((*(dst)) & cfbrmask[idx]) | (((*(dst)) & cfbmask[idx]) & \
|
||||
((((_src1 |(~mask))>>cfb24Shift[idx])&cfbmask[idx]) ^ \
|
||||
(((_src2 &(mask))>>cfb24Shift[idx])&cfbmask[idx])))); \
|
||||
(dst)--; \
|
||||
}
|
||||
|
||||
#define DoMaskMergeRop(src, dst, mask) \
|
||||
((dst) & (((src) & _ca1 ^ _cx1) | ~(mask)) ^ (((src) & _ca2 ^ _cx2) & (mask)))
|
||||
(((dst) & ((((src) & _ca1) ^ _cx1) | ~(mask))) ^ ((((src) & _ca2) ^ _cx2) & (mask)))
|
||||
|
||||
#define DoMaskMergeRop24u(src, dst, mask, i) \
|
||||
(((dst) & ((((src) & _ca1u[(i)]) ^ _cx1u[(i)]) | ~(mask))) ^ ((((src) & _ca2u[(i)]) ^ _cx2u[(i)]) & (mask)))
|
||||
|
||||
#define DoMergeRop24(src,dst,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
MfbBits _src0 = (src);\
|
||||
MfbBits _src1 = (_src0 & _ca1) ^ _cx1; \
|
||||
MfbBits _src2 = (_src0 & _ca2) ^ _cx2; \
|
||||
*(dst) = (((*(dst)) & cfbrmask[idx]) | ((((*(dst)) & cfbmask[idx]) & \
|
||||
((_src1 << cfb24Shift[idx])&cfbmask[idx])) ^ \
|
||||
((_src2 << cfb24Shift[idx])&cfbmask[idx]))); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) = (((*(dst)) & cfbrmask[idx]) | ((((*(dst)) & cfbmask[idx]) & \
|
||||
((_src1 >> cfb24Shift[idx])&cfbmask[idx])) ^ \
|
||||
((_src2 >> cfb24Shift[idx])&cfbmask[idx]))); \
|
||||
(dst)--; \
|
||||
}
|
||||
|
||||
#define DoPrebuiltMergeRop(dst) (((dst) & _cca) ^ _ccx)
|
||||
|
||||
#define DoPrebuiltMergeRop24(dst,index) { \
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
*(dst) = (((*(dst)) & cfbrmask[idx]) | ((((*(dst)) & cfbmask[idx]) &\
|
||||
(( _cca <<cfb24Shift[idx])&cfbmask[idx])) ^ \
|
||||
(( _ccx <<cfb24Shift[idx])&cfbmask[idx]))); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) = (((*(dst)) & cfbrmask[idx]) | ((((*(dst)) & cfbmask[idx]) &\
|
||||
(( _cca >>cfb24Shift[idx])&cfbmask[idx])) ^ \
|
||||
(( _ccx >>cfb24Shift[idx])&cfbmask[idx]))); \
|
||||
(dst)--; \
|
||||
}
|
||||
|
||||
#define DoMaskPrebuiltMergeRop(dst,mask) \
|
||||
(((dst) & (_cca | ~(mask))) ^ (_ccx & (mask)))
|
||||
|
||||
#define PrebuildMergeRop(src) ((_cca = ((src) & _ca1) ^ _cx1), \
|
||||
(_ccx = ((src) & _ca2) ^ _cx2))
|
||||
|
||||
#ifndef MROP
|
||||
#define MROP 0
|
||||
@@ -101,12 +207,38 @@ extern mergeRopRec mergeRopBits[16];
|
||||
#define Mnand (1<<GXnand)
|
||||
#define Mset (1<<GXset)
|
||||
|
||||
#define MROP_PIXEL24(pix, idx) \
|
||||
(((*(pix) & cfbmask[(idx)<<1]) >> cfb24Shift[(idx)<<1])| \
|
||||
((*((pix)+1) & cfbmask[((idx)<<1)+1]) << cfb24Shift[((idx)<<1)+1]))
|
||||
|
||||
#define MROP_SOLID24P(src,dst,sindex, index) \
|
||||
MROP_SOLID24(MROP_PIXEL24(src,sindex),dst,index)
|
||||
|
||||
#define MROP_MASK24P(src,dst,mask,sindex,index) \
|
||||
MROP_MASK24(MROP_PIXEL24(src,sindex),dst,mask,index)
|
||||
|
||||
#if (MROP) == Mcopy
|
||||
#define MROP_DECLARE()
|
||||
#define MROP_DECLARE_REG()
|
||||
#define MROP_INITIALIZE(alu,pm)
|
||||
#define MROP_SOLID(src,dst) (src)
|
||||
#define MROP_MASK(src,dst,mask) ((dst) & ~(mask) | (src) & (mask))
|
||||
#define MROP_SOLID24(src,dst,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
MfbBits _src = (src); \
|
||||
*(dst) = (*(dst) & cfbrmask[idx])|((_src<<cfb24Shift[idx])&cfbmask[idx]); \
|
||||
idx++; \
|
||||
*((dst)+1) = (*((dst)+1) & cfbrmask[idx])|((_src>>cfb24Shift[idx])&cfbmask[idx]); \
|
||||
}
|
||||
#define MROP_MASK(src,dst,mask) (((dst) & ~(mask)) | ((src) & (mask)))
|
||||
#define MROP_MASK24(src,dst,mask,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
MfbBits _src = (src); \
|
||||
*(dst) = (*(dst) & cfbrmask[idx] &(~(((mask)<< cfb24Shift[idx])&cfbmask[idx])) | \
|
||||
(((_src &(mask))<<cfb24Shift[idx])&cfbmask[idx])); \
|
||||
idx++; \
|
||||
*((dst)+1) = (*((dst)+1) & cfbrmask[idx] &(~(((mask)>>cfb24Shift[idx])&cfbmask[idx])) | \
|
||||
(((_src&(mask))>>cfb24Shift[idx])&cfbmask[idx])); \
|
||||
}
|
||||
#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,Copy)
|
||||
#endif
|
||||
|
||||
@@ -115,7 +247,27 @@ extern mergeRopRec mergeRopBits[16];
|
||||
#define MROP_DECLARE_REG()
|
||||
#define MROP_INITIALIZE(alu,pm)
|
||||
#define MROP_SOLID(src,dst) (~(src))
|
||||
#define MROP_MASK(src,dst,mask) ((dst) & ~(mask) | (~(src)) & (mask))
|
||||
#define MROP_SOLID24(src,dst,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
MfbBits _src = ~(src); \
|
||||
*(dst) = (*(dst) & cfbrmask[idx])|((_src << cfb24Shift[idx])&cfbmask[idx]); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) = (*(dst) & cfbrmask[idx])|((_src >>cfb24Shift[idx])&cfbmask[idx]); \
|
||||
(dst)--; \
|
||||
}
|
||||
#define MROP_MASK(src,dst,mask) (((dst) & ~(mask)) | ((~(src)) & (mask)))
|
||||
#define MROP_MASK24(src,dst,mask,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
MfbBits _src = ~(src); \
|
||||
*(dst) = (*(dst) & cfbrmask[idx] &(~(((mask)<< cfb24Shift[idx])&cfbmask[idx])) | \
|
||||
(((_src &(mask))<<cfb24Shift[idx])&cfbmask[idx])); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) = (*(dst) & cfbrmask[idx] &(~(((mask)>>cfb24Shift[idx])&cfbmask[idx])) | \
|
||||
((((_src & (mask))>>cfb24Shift[idx])&cfbmask[idx])); \
|
||||
(dst)--; \
|
||||
}
|
||||
#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,CopyInverted)
|
||||
#endif
|
||||
|
||||
@@ -124,7 +276,24 @@ extern mergeRopRec mergeRopBits[16];
|
||||
#define MROP_DECLARE_REG()
|
||||
#define MROP_INITIALIZE(alu,pm)
|
||||
#define MROP_SOLID(src,dst) ((src) ^ (dst))
|
||||
#define MROP_SOLID24(src,dst,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
MfbBits _src = (src); \
|
||||
*(dst) ^= ((_src << cfb24Shift[idx])&cfbmask[idx]); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) ^= ((_src >>cfb24Shift[idx])&cfbmask[idx]); \
|
||||
(dst)--; \
|
||||
}
|
||||
#define MROP_MASK(src,dst,mask) (((src) & (mask)) ^ (dst))
|
||||
#define MROP_MASK24(src,dst,mask,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
*(dst) ^= ((((src)&(mask))<<cfb24Shift[idx])&cfbmask[idx]); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) ^= ((((src)&(mask))>>cfb24Shift[idx])&cfbmask[idx]); \
|
||||
(dst)--; \
|
||||
}
|
||||
#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,Xor)
|
||||
#endif
|
||||
|
||||
@@ -133,12 +302,29 @@ extern mergeRopRec mergeRopBits[16];
|
||||
#define MROP_DECLARE_REG()
|
||||
#define MROP_INITIALIZE(alu,pm)
|
||||
#define MROP_SOLID(src,dst) ((src) | (dst))
|
||||
#define MROP_SOLID24(src,dst,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
*(dst) |= (((src)<<cfb24Shift[idx])&cfbmask[idx]); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) |= (((src)>>cfb24Shift[idx])&cfbmask[idx]); \
|
||||
(dst)--; \
|
||||
}
|
||||
#define MROP_MASK(src,dst,mask) (((src) & (mask)) | (dst))
|
||||
#define MROP_MASK24(src,dst,mask,index) {\
|
||||
register int idx = ((index) & 3)<< 1; \
|
||||
MfbBits _src = (src); \
|
||||
*(dst) |= (((_src &(mask))<<cfb24Shift[idx])&cfbmask[idx]); \
|
||||
idx++; \
|
||||
(dst)++; \
|
||||
*(dst) |= (((_src &(mask))>>cfb24Shift[idx])&cfbmask[idx]); \
|
||||
(dst)--; \
|
||||
}
|
||||
#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,Or)
|
||||
#endif
|
||||
|
||||
#if (MROP) == (Mcopy|Mxor|MandReverse|Mor)
|
||||
#define MROP_DECLARE() unsigned long _ca1, _cx1;
|
||||
#define MROP_DECLARE() MfbBits _ca1 = 0, _cx1 = 0;
|
||||
#define MROP_DECLARE_REG() register MROP_DECLARE()
|
||||
#define MROP_INITIALIZE(alu,pm) { \
|
||||
mergeRopPtr _bits; \
|
||||
@@ -147,37 +333,60 @@ extern mergeRopRec mergeRopBits[16];
|
||||
_cx1 = _bits->cx1; \
|
||||
}
|
||||
#define MROP_SOLID(src,dst) \
|
||||
((dst) & ((src) & _ca1 ^ _cx1) ^ (src))
|
||||
(((dst) & (((src) & _ca1) ^ _cx1)) ^ (src))
|
||||
#define MROP_MASK(src,dst,mask) \
|
||||
((dst) & (((src) & _ca1 ^ _cx1) | ~(mask)) ^ ((src) & (mask)))
|
||||
(((dst) & ((((src) & _ca1) ^ _cx1)) | (~(mask)) ^ ((src) & (mask))))
|
||||
#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,CopyXorAndReverseOr)
|
||||
#define MROP_PREBUILD(src) PrebuildMergeRop(src)
|
||||
#define MROP_PREBUILT_DECLARE() DeclarePrebuiltMergeRop()
|
||||
#define MROP_PREBUILT_SOLID(src,dst) DoPrebuiltMergeRop(dst)
|
||||
#define MROP_PREBUILT_SOLID24(src,dst,index) DoPrebuiltMergeRop24(dst,index)
|
||||
#define MROP_PREBUILT_MASK(src,dst,mask) DoMaskPrebuiltMergeRop(dst,mask)
|
||||
#define MROP_PREBUILT_MASK24(src,dst,mask,index) DoMaskPrebuiltMergeRop24(dst,mask,index)
|
||||
#endif
|
||||
|
||||
#if (MROP) == 0
|
||||
#if !defined(PSZ) || (PSZ != 24)
|
||||
#define MROP_DECLARE() DeclareMergeRop()
|
||||
#define MROP_DECLARE_REG() register DeclareMergeRop()
|
||||
#define MROP_INITIALIZE(alu,pm) InitializeMergeRop(alu,pm)
|
||||
#define MROP_SOLID(src,dst) DoMergeRop(src,dst)
|
||||
#define MROP_MASK(src,dst,mask) DoMaskMergeRop(src, dst, mask)
|
||||
#else
|
||||
#define MROP_DECLARE() \
|
||||
DeclareMergeRop() \
|
||||
DeclareMergeRop24()
|
||||
#define MROP_DECLARE_REG() \
|
||||
register DeclareMergeRop()\
|
||||
DeclareMergeRop24()
|
||||
#define MROP_INITIALIZE(alu,pm) \
|
||||
InitializeMergeRop(alu,pm)\
|
||||
InitializeMergeRop24(alu,pm)
|
||||
#define MROP_SOLID(src,dst) DoMergeRop24u(src,dst,((int)(&(dst)-pdstBase) % 3))
|
||||
#define MROP_MASK(src,dst,mask) DoMaskMergeRop24u(src, dst, mask,((int)(&(dst) - pdstBase)%3))
|
||||
#endif
|
||||
#define MROP_SOLID24(src,dst,index) DoMergeRop24(src,dst,index)
|
||||
#define MROP_MASK24(src,dst,mask,index) DoMaskMergeRop24(src, dst, mask,index)
|
||||
#define MROP_NAME(prefix) MROP_NAME_CAT(prefix,General)
|
||||
#define MROP_PREBUILD(src) PrebuildMergeRop(src)
|
||||
#define MROP_PREBUILT_DECLARE() DeclarePrebuiltMergeRop()
|
||||
#define MROP_PREBUILT_SOLID(src,dst) DoPrebuiltMergeRop(dst)
|
||||
#define MROP_PREBUILT_SOLID24(src,dst,index) DoPrebuiltMergeRop24(dst,index)
|
||||
#define MROP_PREBUILT_MASK(src,dst,mask) DoMaskPrebuiltMergeRop(dst,mask)
|
||||
#define MROP_PREBUILT_MASK24(src,dst,mask,index) \
|
||||
DoMaskPrebuiltMergeRop24(dst,mask,index)
|
||||
#endif
|
||||
|
||||
#ifndef MROP_PREBUILD
|
||||
#define MROP_PREBUILD(src)
|
||||
#define MROP_PREBUILT_DECLARE()
|
||||
#define MROP_PREBUILT_SOLID(src,dst) MROP_SOLID(src,dst)
|
||||
#define MROP_PREBUILT_SOLID24(src,dst,index) MROP_SOLID24(src,dst,index)
|
||||
#define MROP_PREBUILT_MASK(src,dst,mask) MROP_MASK(src,dst,mask)
|
||||
#define MROP_PREBUILT_MASK24(src,dst,mask,index) MROP_MASK24(src,dst,mask,index)
|
||||
#endif
|
||||
|
||||
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
|
||||
#if !defined(UNIXCPP) || defined(ANSICPP)
|
||||
#define MROP_NAME_CAT(prefix,suffix) prefix##suffix
|
||||
#else
|
||||
#define MROP_NAME_CAT(prefix,suffix) prefix/**/suffix
|
||||
|
||||
90
mfb/mfb.h
90
mfb/mfb.h
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfb.h,v 1.19 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -46,6 +47,12 @@ SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
/* $Xorg: mfb.h,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */
|
||||
|
||||
#if !defined(_MFB_H_) || defined(MFB_PROTOTYPES_ONLY)
|
||||
#ifndef MFB_PROTOTYPES_ONLY
|
||||
#define _MFB_H_
|
||||
#endif
|
||||
|
||||
/* Monochrome Frame Buffer definitions
|
||||
written by drewry, september 1986
|
||||
*/
|
||||
@@ -58,10 +65,14 @@ SOFTWARE.
|
||||
|
||||
extern int InverseAlu[];
|
||||
|
||||
|
||||
/* warning: PixelType definition duplicated in maskbits.h */
|
||||
#ifndef PixelType
|
||||
#define PixelType unsigned long
|
||||
#define PixelType CARD32
|
||||
#endif /* PixelType */
|
||||
#ifndef MfbBits
|
||||
#define MfbBits CARD32
|
||||
#endif
|
||||
|
||||
/* mfbbitblt.c */
|
||||
|
||||
@@ -92,7 +103,20 @@ extern RegionPtr mfbCopyArea(
|
||||
extern Bool mfbRegisterCopyPlaneProc(
|
||||
#if NeedFunctionPrototypes
|
||||
ScreenPtr /*pScreen*/,
|
||||
RegionPtr (* /*proc*/)()
|
||||
RegionPtr (* /*proc*/)(
|
||||
#if NeedNestedPrototypes
|
||||
DrawablePtr /* pSrcDrawable */,
|
||||
DrawablePtr /* pDstDrawable */,
|
||||
GCPtr /* pGC */,
|
||||
int /* srcx */,
|
||||
int /* srcy */,
|
||||
int /* width */,
|
||||
int /* height */,
|
||||
int /* dstx */,
|
||||
int /* dsty */,
|
||||
unsigned long /* bitPlane */
|
||||
#endif
|
||||
)
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -454,7 +478,7 @@ extern void mfbGetSpans(
|
||||
);
|
||||
/* mfbhrzvert.c */
|
||||
|
||||
extern int mfbHorzS(
|
||||
extern void mfbHorzS(
|
||||
#if NeedFunctionPrototypes
|
||||
int /*rop*/,
|
||||
PixelType * /*addrl*/,
|
||||
@@ -465,7 +489,7 @@ extern int mfbHorzS(
|
||||
#endif
|
||||
);
|
||||
|
||||
extern int mfbVertS(
|
||||
extern void mfbVertS(
|
||||
#if NeedFunctionPrototypes
|
||||
int /*rop*/,
|
||||
PixelType * /*addrl*/,
|
||||
@@ -825,6 +849,20 @@ extern Bool mfbScreenInit(
|
||||
int /*width*/
|
||||
#endif
|
||||
);
|
||||
|
||||
extern PixmapPtr mfbGetWindowPixmap(
|
||||
#if NeedFunctionPrototypes
|
||||
WindowPtr /*pWin*/
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void mfbSetWindowPixmap(
|
||||
#if NeedFunctionPrototypes
|
||||
WindowPtr /*pWin*/,
|
||||
PixmapPtr /*pPix*/
|
||||
#endif
|
||||
);
|
||||
|
||||
/* mfbseg.c */
|
||||
|
||||
extern void mfbSegmentSS(
|
||||
@@ -846,7 +884,7 @@ extern void mfbSegmentSD(
|
||||
);
|
||||
/* mfbsetsp.c */
|
||||
|
||||
extern int mfbSetScanline(
|
||||
extern void mfbSetScanline(
|
||||
#if NeedFunctionPrototypes
|
||||
int /*y*/,
|
||||
int /*xOrigin*/,
|
||||
@@ -987,6 +1025,7 @@ extern void mfbZeroPolyArcSS(
|
||||
#endif
|
||||
);
|
||||
|
||||
#ifndef MFB_PROTOTYPES_ONLY
|
||||
/*
|
||||
private filed of pixmap
|
||||
pixmap.devPrivate = (PixelType *)pointer_to_bits
|
||||
@@ -1000,23 +1039,26 @@ displayable screen (e.g. the early vsII, which displayed 960 pixels
|
||||
across, but was 1024 in the hardware.)
|
||||
|
||||
private field of GC
|
||||
Freeing pCompositeClip is done based on the value of
|
||||
freeCompClip; if freeCompClip is not carefully maintained, we will end
|
||||
up losing storage or freeing something that isn't ours.
|
||||
*/
|
||||
typedef void (*mfbFillAreaProcPtr)(
|
||||
#if NeedNestedPrototypes
|
||||
DrawablePtr /*pDraw*/,
|
||||
int /*nbox*/,
|
||||
BoxPtr /*pbox*/,
|
||||
int /*alu*/,
|
||||
PixmapPtr /*nop*/
|
||||
#endif
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
unsigned char rop; /* reduction of rasterop to 1 of 3 */
|
||||
unsigned char ropOpStip; /* rop for opaque stipple */
|
||||
unsigned char ropFillArea; /* == alu, rop, or ropOpStip */
|
||||
unsigned fExpose:1; /* callexposure handling ? */
|
||||
unsigned freeCompClip:1;
|
||||
PixmapPtr pRotatedPixmap; /* tile/stipple rotated to align */
|
||||
RegionPtr pCompositeClip; /* free this based on freeCompClip
|
||||
flag rather than NULLness */
|
||||
void (* FillArea)(); /* fills regions; look at the code */
|
||||
unsigned char unused1[sizeof(long) - 3]; /* Alignment */
|
||||
mfbFillAreaProcPtr FillArea; /* fills regions; look at the code */
|
||||
} mfbPrivGC;
|
||||
typedef mfbPrivGC *mfbPrivGCPtr;
|
||||
#endif
|
||||
|
||||
extern int mfbGCPrivateIndex; /* index into GC private array */
|
||||
extern int mfbWindowPrivateIndex; /* index into Window private array */
|
||||
@@ -1024,6 +1066,7 @@ extern int mfbWindowPrivateIndex; /* index into Window private array */
|
||||
extern int frameWindowPrivateIndex; /* index into Window private array */
|
||||
#endif
|
||||
|
||||
#ifndef MFB_PROTOTYPES_ONLY
|
||||
/* private field of window */
|
||||
typedef struct {
|
||||
unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */
|
||||
@@ -1036,10 +1079,10 @@ typedef struct {
|
||||
|
||||
/* Common macros for extracting drawing information */
|
||||
|
||||
#define mfbGetTypedWidth(pDrawable,type) (\
|
||||
#define mfbGetTypedWidth(pDrawable,wtype) (\
|
||||
(((pDrawable)->type == DRAWABLE_WINDOW) ? \
|
||||
(int) (((PixmapPtr)((pDrawable)->pScreen->devPrivate))->devKind) : \
|
||||
(int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (type))
|
||||
(int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
|
||||
|
||||
#define mfbGetByteWidth(pDrawable) mfbGetTypedWidth(pDrawable, unsigned char)
|
||||
|
||||
@@ -1161,7 +1204,8 @@ than a switch on the rop per item (span or rectangle.)
|
||||
#define fnCOPYINVERTED(src, dst)(~src)
|
||||
#define fnORINVERTED(src, dst) (~src | dst)
|
||||
#define fnNAND(src, dst) (~(src & dst))
|
||||
#define fnSET(src, dst) (~0)
|
||||
#undef fnSET
|
||||
#define fnSET(src, dst) (MfbBits)(~0)
|
||||
|
||||
/* Using a "switch" statement is much faster in most cases
|
||||
* since the compiler can do a look-up table or multi-way branch
|
||||
@@ -1177,6 +1221,7 @@ than a switch on the rop per item (span or rectangle.)
|
||||
* Note that this requires a change to the "calling sequence"
|
||||
* since we can't engineer a "switch" statement to have an lvalue.
|
||||
*/
|
||||
#undef DoRop
|
||||
#define DoRop(result, alu, src, dst) \
|
||||
{ \
|
||||
if (alu == GXcopy) \
|
||||
@@ -1198,6 +1243,7 @@ than a switch on the rop per item (span or rectangle.)
|
||||
case GXandInverted: \
|
||||
result = fnANDINVERTED (src, dst); \
|
||||
break; \
|
||||
default: \
|
||||
case GXnoop: \
|
||||
result = fnNOOP (src, dst); \
|
||||
break; \
|
||||
@@ -1248,3 +1294,13 @@ than a switch on the rop per item (span or rectangle.)
|
||||
#define MFB_EQWHOLEWORD_INVERT ^=~0
|
||||
#define MFB_OP_WHITE /* nothing */
|
||||
#define MFB_OP_BLACK ~
|
||||
|
||||
/*
|
||||
* if MFB is built as a module, it shouldn't call libc functions.
|
||||
*/
|
||||
#ifdef XFree86LOADER
|
||||
#include "xf86_ansic.h"
|
||||
#endif
|
||||
|
||||
#endif /* MFB_PROTOTYPES_ONLY */
|
||||
#endif /* _MFB_H_ */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbbitblt.c,v 1.6 2001/12/14 20:00:04 dawes Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -132,7 +133,7 @@ int srcx, srcy;
|
||||
int width, height;
|
||||
int dstx, dsty;
|
||||
{
|
||||
RegionPtr prgnSrcClip; /* may be a new region, or just a copy */
|
||||
RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
|
||||
Bool freeSrcClip = FALSE;
|
||||
|
||||
RegionPtr prgnExposed;
|
||||
@@ -192,7 +193,7 @@ int dstx, dsty;
|
||||
if ((pSrcDrawable == pDstDrawable) &&
|
||||
(pGC->clientClipType == CT_NONE))
|
||||
{
|
||||
prgnSrcClip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
prgnSrcClip = pGC->pCompositeClip;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -214,7 +215,7 @@ int dstx, dsty;
|
||||
else if ((pSrcDrawable == pDstDrawable) &&
|
||||
(pGC->clientClipType == CT_NONE))
|
||||
{
|
||||
prgnSrcClip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
prgnSrcClip = pGC->pCompositeClip;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -300,7 +301,7 @@ int dstx, dsty;
|
||||
/* If the destination composite clip is one rectangle we can
|
||||
do the clip directly. Otherwise we have to create a full
|
||||
blown region and call intersect */
|
||||
cclip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
cclip = pGC->pCompositeClip;
|
||||
if (REGION_NUM_RECTS(cclip) == 1)
|
||||
{
|
||||
BoxPtr pBox = REGION_RECTS(cclip);
|
||||
@@ -336,8 +337,7 @@ int dstx, dsty;
|
||||
|
||||
if (!fastClip)
|
||||
{
|
||||
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
|
||||
}
|
||||
|
||||
/* Do bit blitting */
|
||||
@@ -367,7 +367,7 @@ int dstx, dsty;
|
||||
}
|
||||
|
||||
prgnExposed = NULL;
|
||||
if (((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->fExpose)
|
||||
if (pGC->fExpose)
|
||||
{
|
||||
/* Pixmap sources generate a NoExposed (we return NULL to do this) */
|
||||
if (!fastExpose)
|
||||
|
||||
20
mfb/mfbblt.c
20
mfb/mfbblt.c
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* mfb copy area
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbblt.c,v 3.4 2001/12/14 20:00:04 dawes Exp $ */
|
||||
|
||||
/*
|
||||
|
||||
@@ -82,14 +83,7 @@ MROP_NAME(mfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc)
|
||||
register PixelType bits;
|
||||
register PixelType bits1;
|
||||
register int nl; /* temp copy of nlMiddle */
|
||||
|
||||
/* place to store full source word */
|
||||
int nstart; /* number of ragged bits at start of dst */
|
||||
int nend; /* number of ragged bits at end of dst */
|
||||
int srcStartOver; /* pulling nstart bits from src
|
||||
overflows into the next word? */
|
||||
int careful;
|
||||
int tmpSrc;
|
||||
|
||||
MROP_INITIALIZE(alu,0);
|
||||
|
||||
@@ -336,8 +330,10 @@ psrc += UNROLL;
|
||||
if (startmask)
|
||||
{
|
||||
bits1 = BitLeft(bits,leftShift);
|
||||
bits = *psrc++;
|
||||
bits1 |= BitRight(bits,rightShift);
|
||||
if (BitLeft(startmask, rightShift)) {
|
||||
bits = *psrc++;
|
||||
bits1 |= BitRight(bits,rightShift);
|
||||
}
|
||||
*pdst = MROP_MASK(bits1, *pdst, startmask);
|
||||
pdst++;
|
||||
}
|
||||
@@ -500,8 +496,10 @@ psrc -= UNROLL;
|
||||
if (endmask)
|
||||
{
|
||||
bits1 = BitRight(bits, rightShift);
|
||||
bits = *--psrc;
|
||||
bits1 |= BitLeft(bits, leftShift);
|
||||
if (BitRight(endmask, leftShift)) {
|
||||
bits = *--psrc;
|
||||
bits1 |= BitLeft(bits, leftShift);
|
||||
}
|
||||
pdst--;
|
||||
*pdst = MROP_MASK(bits1, *pdst, endmask);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbbres.c,v 1.5 2001/12/14 20:00:05 dawes Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -71,7 +72,7 @@ int e2;
|
||||
int len; /* length of line */
|
||||
{
|
||||
register int yinc; /* increment to next scanline, in bytes */
|
||||
register PixelType *addrl; /* bitmask long pointer */
|
||||
register PixelType *addrl; /* bitmask 32-bit pointer */
|
||||
register PixelType bit; /* current bit being set/cleared/etc. */
|
||||
PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
|
||||
PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbbresd.c,v 1.5 2001/12/14 20:00:05 dawes Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -87,7 +88,7 @@ int len; /* length of line */
|
||||
register int yinc; /* increment to next scanline, in bytes */
|
||||
register PixelType *addrl;
|
||||
register int e3 = e2-e1;
|
||||
register unsigned long bit;
|
||||
register MfbBits bit;
|
||||
PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
|
||||
PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
|
||||
int dashIndex;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbclip.c,v 1.5 2001/12/14 20:00:05 dawes Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -53,6 +54,7 @@ SOFTWARE.
|
||||
#include "gc.h"
|
||||
#include "maskbits.h"
|
||||
#include "mi.h"
|
||||
#include "mfb.h"
|
||||
|
||||
#define ADDRECT(reg,r,fr,rx1,ry1,rx2,ry2) \
|
||||
if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
|
||||
@@ -93,7 +95,7 @@ mfbPixmapToRegion(pPix)
|
||||
register RegionPtr pReg;
|
||||
register PixelType *pw, w;
|
||||
register int ib;
|
||||
int width, h, base, rx1, crects;
|
||||
int width, h, base, rx1 = 0, crects;
|
||||
PixelType *pwLineEnd;
|
||||
int irectPrevStart, irectLineStart;
|
||||
register BoxPtr prectO, prectN;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbcmap.c,v 1.8 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -49,6 +50,8 @@ SOFTWARE.
|
||||
#include "scrnintstr.h"
|
||||
#include "colormapst.h"
|
||||
#include "resource.h"
|
||||
#include "micmap.h"
|
||||
#include "mfb.h"
|
||||
|
||||
/* A monochrome frame buffer is a static gray colormap with two entries.
|
||||
* We have a "required list" of length 1. Because we can only support 1
|
||||
@@ -63,17 +66,13 @@ SOFTWARE.
|
||||
* The required list concept is pretty much irrelevant when you can only
|
||||
* have one map installed at a time.
|
||||
*/
|
||||
static ColormapPtr InstalledMaps[MAXSCREENS];
|
||||
|
||||
int
|
||||
mfbListInstalledColormaps(pScreen, pmaps)
|
||||
ScreenPtr pScreen;
|
||||
Colormap *pmaps;
|
||||
{
|
||||
/* By the time we are processing requests, we can guarantee that there
|
||||
* is always a colormap installed */
|
||||
*pmaps = InstalledMaps[pScreen->myNum]->mid;
|
||||
return (1);
|
||||
return miListInstalledColormaps(pScreen, pmaps);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,38 +80,14 @@ void
|
||||
mfbInstallColormap(pmap)
|
||||
ColormapPtr pmap;
|
||||
{
|
||||
int index = pmap->pScreen->myNum;
|
||||
ColormapPtr oldpmap = InstalledMaps[index];
|
||||
|
||||
if(pmap != oldpmap)
|
||||
{
|
||||
/* Uninstall pInstalledMap. No hardware changes required, just
|
||||
* notify all interested parties. */
|
||||
if(oldpmap != (ColormapPtr)None)
|
||||
WalkTree(pmap->pScreen, TellLostMap, (pointer)&oldpmap->mid);
|
||||
/* Install pmap */
|
||||
InstalledMaps[index] = pmap;
|
||||
WalkTree(pmap->pScreen, TellGainedMap, (pointer)&pmap->mid);
|
||||
|
||||
}
|
||||
miInstallColormap(pmap);
|
||||
}
|
||||
|
||||
void
|
||||
mfbUninstallColormap(pmap)
|
||||
ColormapPtr pmap;
|
||||
{
|
||||
int index = pmap->pScreen->myNum;
|
||||
ColormapPtr curpmap = InstalledMaps[index];
|
||||
|
||||
if(pmap == curpmap)
|
||||
{
|
||||
if (pmap->mid != pmap->pScreen->defColormap)
|
||||
{
|
||||
curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
|
||||
RT_COLORMAP);
|
||||
(*pmap->pScreen->InstallColormap)(curpmap);
|
||||
}
|
||||
}
|
||||
miUninstallColormap(pmap);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
@@ -181,18 +156,5 @@ Bool
|
||||
mfbCreateDefColormap (pScreen)
|
||||
ScreenPtr pScreen;
|
||||
{
|
||||
VisualPtr pVisual;
|
||||
ColormapPtr pColormap;
|
||||
|
||||
for (pVisual = pScreen->visuals;
|
||||
pVisual->vid != pScreen->rootVisual;
|
||||
pVisual++)
|
||||
;
|
||||
if (CreateColormap (pScreen->defColormap, pScreen, pVisual,
|
||||
&pColormap, AllocNone, 0) != Success)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
(*pScreen->InstallColormap) (pColormap);
|
||||
return TRUE;
|
||||
return miCreateDefColormap(pScreen);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbfillarc.c,v 1.5 2001/12/14 20:00:06 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
@@ -288,7 +289,7 @@ mfbPolyFillArcSolid(pDraw, pGC, narcs, parcs)
|
||||
rop = priv->rop;
|
||||
if ((rop == RROP_NOP) || !(pGC->planemask & 1))
|
||||
return;
|
||||
cclip = priv->pCompositeClip;
|
||||
cclip = pGC->pCompositeClip;
|
||||
for (arc = parcs, i = narcs; --i >= 0; arc++)
|
||||
{
|
||||
if (miFillArcEmpty(arc))
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbfillrct.c,v 1.6 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -59,7 +60,6 @@ SOFTWARE.
|
||||
#include "maskbits.h"
|
||||
|
||||
#define MODEQ(a, b) ((a) %= (b))
|
||||
void mfbPaintOddSize();
|
||||
|
||||
/*
|
||||
filled rectangles.
|
||||
@@ -88,7 +88,7 @@ mfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
|
||||
int xorg, yorg;
|
||||
mfbPrivGC *priv;
|
||||
int alu;
|
||||
void (* pfn) ();
|
||||
mfbFillAreaProcPtr pfn;
|
||||
PixmapPtr ppix;
|
||||
|
||||
if (!(pGC->planemask & 1))
|
||||
@@ -97,8 +97,8 @@ mfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
|
||||
priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
|
||||
alu = priv->ropFillArea;
|
||||
pfn = priv->FillArea;
|
||||
ppix = priv->pRotatedPixmap;
|
||||
prgnClip = priv->pCompositeClip;
|
||||
ppix = pGC->pRotatedPixmap;
|
||||
prgnClip = pGC->pCompositeClip;
|
||||
|
||||
prect = prectInit;
|
||||
xorg = pDrawable->x;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbfillsp.c,v 1.9 2001/12/14 20:00:06 dawes Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -107,7 +108,7 @@ mfbBlackSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -118,8 +119,7 @@ mfbBlackSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
|
||||
@@ -180,7 +180,7 @@ mfbWhiteSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -191,8 +191,7 @@ mfbWhiteSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
|
||||
@@ -253,7 +252,7 @@ mfbInvertSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -264,8 +263,7 @@ mfbInvertSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
|
||||
@@ -329,7 +327,7 @@ mfbWhiteStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -340,13 +338,12 @@ mfbWhiteStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
|
||||
|
||||
pStipple = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pRotatedPixmap;
|
||||
pStipple = pGC->pRotatedPixmap;
|
||||
tileHeight = pStipple->drawable.height;
|
||||
psrc = (PixelType *)(pStipple->devPrivate.ptr);
|
||||
|
||||
@@ -407,7 +404,7 @@ mfbBlackStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -418,13 +415,12 @@ mfbBlackStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
|
||||
|
||||
pStipple = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pRotatedPixmap;
|
||||
pStipple = pGC->pRotatedPixmap;
|
||||
tileHeight = pStipple->drawable.height;
|
||||
psrc = (PixelType *)(pStipple->devPrivate.ptr);
|
||||
|
||||
@@ -485,7 +481,7 @@ mfbInvertStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -496,13 +492,12 @@ mfbInvertStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
|
||||
|
||||
pStipple = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pRotatedPixmap;
|
||||
pStipple = pGC->pRotatedPixmap;
|
||||
tileHeight = pStipple->drawable.height;
|
||||
psrc = (PixelType *)(pStipple->devPrivate.ptr);
|
||||
|
||||
@@ -599,13 +594,13 @@ mfbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
int rop;
|
||||
int *pwidthFree; /* copies of the pointers to free */
|
||||
DDXPointPtr pptFree;
|
||||
unsigned long flip;
|
||||
MfbBits flip;
|
||||
|
||||
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -616,13 +611,12 @@ mfbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
mfbGetPixelWidthAndPointer(pDrawable, nlwidth, addrlBase);
|
||||
|
||||
pTile = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pRotatedPixmap;
|
||||
pTile = pGC->pRotatedPixmap;
|
||||
tileHeight = pTile->drawable.height;
|
||||
psrc = (PixelType *)(pTile->devPrivate.ptr);
|
||||
if (pGC->fillStyle == FillTiled)
|
||||
@@ -638,7 +632,7 @@ mfbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
case GXcopy:
|
||||
{
|
||||
|
||||
#define DoMaskCopyRop(src,dst,mask) ((dst) & ~(mask) | (src) & (mask))
|
||||
#define DoMaskCopyRop(src,dst,mask) (((dst) & ~(mask)) | ((src) & (mask)))
|
||||
|
||||
while (n--)
|
||||
{
|
||||
@@ -749,7 +743,7 @@ mfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -760,8 +754,7 @@ mfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
if (pGC->fillStyle == FillTiled)
|
||||
@@ -848,8 +841,16 @@ mfbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
{
|
||||
putbitsrop(*psrc, (x & PIM), nstart, pdst, rop);
|
||||
pdst++;
|
||||
#if defined(__alpha__) || defined(__alpha)
|
||||
/*
|
||||
* XXX workaround an egcs 1.1.2 code generation
|
||||
* bug. This version might actually be faster.
|
||||
*/
|
||||
psrc += srcStartOver;
|
||||
#else
|
||||
if(srcStartOver)
|
||||
psrc++;
|
||||
#endif
|
||||
}
|
||||
|
||||
while(nlMiddle--)
|
||||
@@ -908,7 +909,7 @@ mfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
n = nInit * miFindMaxBand(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
n = nInit * miFindMaxBand(pGC->pCompositeClip);
|
||||
pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
|
||||
pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
|
||||
if(!pptFree || !pwidthFree)
|
||||
@@ -919,8 +920,7 @@ mfbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
||||
}
|
||||
pwidth = pwidthFree;
|
||||
ppt = pptFree;
|
||||
n = miClipSpans(((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip,
|
||||
pptInit, pwidthInit, nInit,
|
||||
n = miClipSpans(pGC->pCompositeClip, pptInit, pwidthInit, nInit,
|
||||
ppt, pwidth, fSorted);
|
||||
|
||||
pTile = pGC->stipple;
|
||||
|
||||
43
mfb/mfbgc.c
43
mfb/mfbgc.c
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbgc.c,v 1.8 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -735,10 +736,10 @@ mfbCreateGC(pGC)
|
||||
|
||||
pPriv = (mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr);
|
||||
pPriv->rop = mfbReduceRop(pGC->alu, pGC->fgPixel);
|
||||
pPriv->fExpose = TRUE;
|
||||
pPriv->pRotatedPixmap = NullPixmap;
|
||||
pPriv->freeCompClip = FALSE;
|
||||
pPriv->FillArea = mfbSolidWhiteArea;
|
||||
pGC->fExpose = TRUE;
|
||||
pGC->pRotatedPixmap = NullPixmap;
|
||||
pGC->freeCompClip = FALSE;
|
||||
pPriv->FillArea = mfbSolidInvertArea;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -909,7 +910,7 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
!(pGC->tile.pixmap->drawable.width & (pGC->tile.pixmap->drawable.width - 1)))
|
||||
{
|
||||
mfbCopyRotatePixmap(pGC->tile.pixmap,
|
||||
&devPriv->pRotatedPixmap, xrot, yrot);
|
||||
&pGC->pRotatedPixmap, xrot, yrot);
|
||||
new_pix = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -919,15 +920,15 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
!(pGC->stipple->drawable.width & (pGC->stipple->drawable.width - 1)))
|
||||
{
|
||||
mfbCopyRotatePixmap(pGC->stipple,
|
||||
&devPriv->pRotatedPixmap, xrot, yrot);
|
||||
&pGC->pRotatedPixmap, xrot, yrot);
|
||||
new_pix = TRUE;
|
||||
}
|
||||
}
|
||||
/* destroy any previously rotated tile or stipple */
|
||||
if (!new_pix && devPriv->pRotatedPixmap)
|
||||
if (!new_pix && pGC->pRotatedPixmap)
|
||||
{
|
||||
(*pDrawable->pScreen->DestroyPixmap)(devPriv->pRotatedPixmap);
|
||||
devPriv->pRotatedPixmap = (PixmapPtr)NULL;
|
||||
(*pDrawable->pScreen->DestroyPixmap)(pGC->pRotatedPixmap);
|
||||
pGC->pRotatedPixmap = (PixmapPtr)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -981,7 +982,7 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
{
|
||||
GCOps *newops;
|
||||
|
||||
if (newops = matchCommon (pGC))
|
||||
if ((newops = matchCommon (pGC)))
|
||||
{
|
||||
if (pGC->ops->devPrivate.val)
|
||||
miDestroyGCOps (pGC->ops);
|
||||
@@ -1151,11 +1152,11 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
/* beyond this point, opaqueStippled ==> fg != bg */
|
||||
else if (((pGC->fillStyle == FillTiled) ||
|
||||
(pGC->fillStyle == FillOpaqueStippled)) &&
|
||||
!devPriv->pRotatedPixmap)
|
||||
!pGC->pRotatedPixmap)
|
||||
{
|
||||
pGC->ops->FillSpans = mfbUnnaturalTileFS;
|
||||
}
|
||||
else if ((pGC->fillStyle == FillStippled) && !devPriv->pRotatedPixmap)
|
||||
else if ((pGC->fillStyle == FillStippled) && !pGC->pRotatedPixmap)
|
||||
{
|
||||
pGC->ops->FillSpans = mfbUnnaturalStippleFS;
|
||||
}
|
||||
@@ -1190,7 +1191,7 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
*/
|
||||
if ((((pGC->fillStyle == FillTiled) ||
|
||||
(pGC->fillStyle == FillStippled)) &&
|
||||
!devPriv->pRotatedPixmap) ||
|
||||
!pGC->pRotatedPixmap) ||
|
||||
((pGC->fillStyle == FillOpaqueStippled) &&
|
||||
((pGC->fgPixel & 1) != (pGC->bgPixel & 1)))
|
||||
)
|
||||
@@ -1217,7 +1218,7 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
devPriv->FillArea = mfbSolidInvertArea;
|
||||
break;
|
||||
case RROP_NOP:
|
||||
devPriv->FillArea = (void (*)())NoopDDA;
|
||||
devPriv->FillArea = (mfbFillAreaProcPtr)NoopDDA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1235,7 +1236,7 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
devPriv->FillArea = mfbStippleInvertArea;
|
||||
break;
|
||||
case RROP_NOP:
|
||||
devPriv->FillArea = (void (*)())NoopDDA;
|
||||
devPriv->FillArea = (mfbFillAreaProcPtr)NoopDDA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1288,11 +1289,11 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
/* beyond this point, opaqueStippled ==> fg != bg */
|
||||
else if (((pGC->fillStyle == FillTiled) ||
|
||||
(pGC->fillStyle == FillOpaqueStippled)) &&
|
||||
!devPriv->pRotatedPixmap)
|
||||
!pGC->pRotatedPixmap)
|
||||
{
|
||||
pGC->ops->FillSpans = mfbUnnaturalTileFS;
|
||||
}
|
||||
else if ((pGC->fillStyle == FillStippled) && !devPriv->pRotatedPixmap)
|
||||
else if ((pGC->fillStyle == FillStippled) && !pGC->pRotatedPixmap)
|
||||
{
|
||||
pGC->ops->FillSpans = mfbUnnaturalStippleFS;
|
||||
}
|
||||
@@ -1321,7 +1322,7 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
*/
|
||||
if ((((pGC->fillStyle == FillTiled) ||
|
||||
(pGC->fillStyle == FillStippled)) &&
|
||||
!devPriv->pRotatedPixmap) ||
|
||||
!pGC->pRotatedPixmap) ||
|
||||
((pGC->fillStyle == FillOpaqueStippled) &&
|
||||
((pGC->fgPixel & 1) != (pGC->bgPixel & 1)))
|
||||
)
|
||||
@@ -1348,7 +1349,7 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
devPriv->FillArea = mfbSolidInvertArea;
|
||||
break;
|
||||
case RROP_NOP:
|
||||
devPriv->FillArea = (void (*)())NoopDDA;
|
||||
devPriv->FillArea = (mfbFillAreaProcPtr)NoopDDA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1366,7 +1367,7 @@ mfbValidateGC(pGC, changes, pDrawable)
|
||||
devPriv->FillArea = mfbStippleInvertArea;
|
||||
break;
|
||||
case RROP_NOP:
|
||||
devPriv->FillArea = (void (*)())NoopDDA;
|
||||
devPriv->FillArea = (mfbFillAreaProcPtr)NoopDDA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1414,7 +1415,7 @@ mfbReduceRop(alu, src)
|
||||
register int alu;
|
||||
register Pixel src;
|
||||
{
|
||||
int rop;
|
||||
int rop = 0;
|
||||
if ((src & 1) == 0) /* src is black */
|
||||
{
|
||||
switch(alu)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbgetsp.c,v 1.4 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -76,7 +77,7 @@ mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
|
||||
int nspans; /* number of scanlines to copy */
|
||||
char *pchardstStart; /* where to put the bits */
|
||||
{
|
||||
PixelType *pdstStart = (PixelType *)pchardstStart;
|
||||
PixelType *pdstStart = (PixelType *)(pointer)pchardstStart;
|
||||
register PixelType *pdst; /* where to put the bits */
|
||||
register PixelType *psrc; /* where to get the bits */
|
||||
register PixelType tmpSrc; /* scratch buffer for bits */
|
||||
@@ -85,7 +86,7 @@ mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
|
||||
register DDXPointPtr pptLast; /* one past last point to get */
|
||||
int xEnd; /* last pixel to copy from */
|
||||
register int nstart;
|
||||
int nend;
|
||||
int nend = 0;
|
||||
int srcStartOver;
|
||||
PixelType startmask, endmask;
|
||||
unsigned int srcBit;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbhrzvert.c,v 1.5 2001/12/14 20:00:08 dawes Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -59,6 +60,7 @@ SOFTWARE.
|
||||
/* horizontal solid line
|
||||
abs(len) > 1
|
||||
*/
|
||||
void
|
||||
mfbHorzS(rop, addrl, nlwidth, x1, y1, len)
|
||||
int rop; /* a reduced rasterop */
|
||||
register PixelType *addrl; /* pointer to base of bitmap */
|
||||
@@ -137,6 +139,7 @@ int len; /* length of line */
|
||||
it's OK to use it.
|
||||
*/
|
||||
|
||||
void
|
||||
mfbVertS(rop, addrl, nlwidth, x1, y1, len)
|
||||
int rop; /* a reduced rasterop */
|
||||
register PixelType *addrl; /* pointer to base of bitmap */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbimage.c,v 1.6 2001/12/14 20:00:08 dawes Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -109,14 +110,14 @@ mfbPutImage(dst, pGC, depth, x, y, w, h, leftPad, format, pImage)
|
||||
if (!pPixmap)
|
||||
return;
|
||||
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->fExpose = FALSE;
|
||||
pGC->fExpose = FALSE;
|
||||
if (format != XYBitmap)
|
||||
(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, dst, pGC, leftPad, 0,
|
||||
w, h, x, y);
|
||||
else
|
||||
(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, dst, pGC, leftPad, 0,
|
||||
w, h, x, y, 1);
|
||||
((mfbPrivGC*)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->fExpose = TRUE;
|
||||
pGC->fExpose = TRUE;
|
||||
FreeScratchPixmapHeader(pPixmap);
|
||||
}
|
||||
|
||||
@@ -139,7 +140,6 @@ mfbGetImage( pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
|
||||
unsigned long planeMask;
|
||||
char *pdstLine;
|
||||
{
|
||||
PixmapPtr pPixmap;
|
||||
BoxRec box;
|
||||
DDXPointRec ptSrc;
|
||||
RegionRec rgnDst;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbimggblt.c,v 3.5 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -138,7 +139,8 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
register PixelType endmask;
|
||||
|
||||
register int nFirst;/* bits of glyph in current longword */
|
||||
void (* oldFillArea)();
|
||||
mfbPrivGC *pPrivGC;
|
||||
mfbFillAreaProcPtr oldFillArea;
|
||||
/* we might temporarily usurp this
|
||||
field in devPriv */
|
||||
|
||||
@@ -165,9 +167,8 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
bbox.y2 = y + info.overallDescent;
|
||||
|
||||
/* UNCLEAN CODE
|
||||
we know the mfbPolyFillRect uses only three fields in
|
||||
devPrivate[mfbGCPrivateIndex].ptr, two of which (the rotated
|
||||
tile/stipple and the ropFillArea) are
|
||||
we know the mfbPolyFillRect uses only two fields in
|
||||
devPrivate[mfbGCPrivateIndex].ptr, one of which (ropFillArea) is
|
||||
irrelevant for solid filling, so we just poke the FillArea
|
||||
field. the GC is now in an inconsistent state, but we'll fix
|
||||
it as soon as PolyFillRect returns. fortunately, the server
|
||||
@@ -181,27 +182,23 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
but that is usually not a cheap thing to do.
|
||||
*/
|
||||
|
||||
oldFillArea = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->FillArea;
|
||||
pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr;
|
||||
oldFillArea = pPrivGC->FillArea;
|
||||
|
||||
/* pcc doesn't like this. why?
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->FillArea =
|
||||
((pGC->bgPixel & 1) ? mfbSolidWhiteArea : mfbSolidBlackArea);
|
||||
*/
|
||||
if (pGC->bgPixel & 1)
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->FillArea = mfbSolidWhiteArea;
|
||||
pPrivGC->FillArea = mfbSolidWhiteArea;
|
||||
else
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->FillArea = mfbSolidBlackArea;
|
||||
pPrivGC->FillArea = mfbSolidBlackArea;
|
||||
|
||||
#ifndef LOWMEMFTPT
|
||||
mfbPolyFillRect(pDrawable, pGC, 1, &backrect);
|
||||
#else
|
||||
miPolyFillRect(pDrawable, pGC, 1, &backrect);
|
||||
#endif
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->FillArea = oldFillArea;
|
||||
pPrivGC->FillArea = oldFillArea;
|
||||
|
||||
/* the faint-hearted can open their eyes now */
|
||||
switch (RECT_IN_REGION(pGC->pScreen,
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip, &bbox))
|
||||
switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
|
||||
{
|
||||
case rgnOUT:
|
||||
break;
|
||||
@@ -218,7 +215,7 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
|
||||
|
||||
/* start at top scanline of glyph */
|
||||
pdst = mfbScanlineDelta(pdstBase, -pci->metrics.ascent, widthDst);
|
||||
pdst = pdstBase;
|
||||
|
||||
/* find correct word in scanline and x offset within it
|
||||
for left edge of glyph
|
||||
@@ -235,6 +232,8 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
pdst--;
|
||||
}
|
||||
|
||||
pdst = mfbScanlineDelta(pdst, -pci->metrics.ascent, widthDst);
|
||||
|
||||
if ((xoff + w) <= PPW)
|
||||
{
|
||||
/* glyph all in one longword */
|
||||
@@ -328,7 +327,7 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
}
|
||||
}
|
||||
|
||||
cclip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
cclip = pGC->pCompositeClip;
|
||||
pbox = REGION_RECTS(cclip);
|
||||
nbox = REGION_NUM_RECTS(cclip);
|
||||
|
||||
@@ -388,7 +387,7 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
pglyph = FONTGLYPHBITS(pglyphBase, pci);
|
||||
pglyph += (glyphRow * widthGlyph);
|
||||
|
||||
pdst = mfbScanlineDelta(ppos[i].pdstBase, -(y-topEdge), widthDst);
|
||||
pdst = ppos[i].pdstBase;
|
||||
|
||||
glyphCol = (leftEdge - ppos[i].xpos) -
|
||||
(pci->metrics.leftSideBearing);
|
||||
@@ -405,6 +404,8 @@ MFBIMAGEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
pdst--;
|
||||
}
|
||||
|
||||
pdst = mfbScanlineDelta(pdst, -(y-topEdge), widthDst);
|
||||
|
||||
if ((xoff + w) <= PPW)
|
||||
{
|
||||
maskpartialbits(xoff, w, startmask);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbline.c,v 1.7 2001/12/14 20:00:09 dawes Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -115,7 +116,9 @@ mfbLineSS (pDrawable, pGC, mode, npt, pptInit)
|
||||
unsigned int oc2; /* outcode of point 2 */
|
||||
|
||||
PixelType *addrlBase; /* pointer to start of drawable */
|
||||
#ifndef POLYSEGMENT
|
||||
PixelType *addrl; /* address of destination pixmap */
|
||||
#endif
|
||||
int nlwidth; /* width in longwords of destination pixmap */
|
||||
int xorg, yorg; /* origin of window */
|
||||
|
||||
@@ -138,7 +141,7 @@ mfbLineSS (pDrawable, pGC, mode, npt, pptInit)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
cclip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
cclip = pGC->pCompositeClip;
|
||||
alu = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop;
|
||||
pboxInit = REGION_RECTS(cclip);
|
||||
nboxInit = REGION_NUM_RECTS(cclip);
|
||||
@@ -505,7 +508,7 @@ mfbLineSD( pDrawable, pGC, mode, npt, pptInit)
|
||||
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
|
||||
int x1, x2, y1, y2;
|
||||
RegionPtr cclip;
|
||||
int fgrop, bgrop;
|
||||
int fgrop = 0, bgrop = 0;
|
||||
unsigned char *pDash;
|
||||
int dashOffset;
|
||||
int numInDashList;
|
||||
@@ -517,7 +520,7 @@ mfbLineSD( pDrawable, pGC, mode, npt, pptInit)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
|
||||
cclip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
cclip = pGC->pCompositeClip;
|
||||
fgrop = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop;
|
||||
pboxInit = REGION_RECTS(cclip);
|
||||
nboxInit = REGION_NUM_RECTS(cclip);
|
||||
@@ -723,7 +726,7 @@ dontStep: ;
|
||||
(x2 < pbox->x2) &&
|
||||
(y2 < pbox->y2))
|
||||
{
|
||||
unsigned long _mask;
|
||||
MfbBits _mask;
|
||||
int rop;
|
||||
|
||||
rop = fgrop;
|
||||
|
||||
@@ -26,6 +26,8 @@ in this Software without prior written authorization from The Open Group.
|
||||
* Author: Keith Packard, MIT X Consortium
|
||||
*/
|
||||
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbply1rct.c,v 1.8 2002/12/09 04:10:57 tsi Exp $ */
|
||||
|
||||
#include "X.h"
|
||||
|
||||
#include "gcstruct.h"
|
||||
@@ -46,12 +48,12 @@ in this Software without prior written authorization from The Open Group.
|
||||
|
||||
#if IMAGE_BYTE_ORDER == MSBFirst
|
||||
#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i))))
|
||||
#define coordToInt(x,y) (((x) << 16) | (y))
|
||||
#define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff))
|
||||
#define intToX(i) (GetHighWord(i))
|
||||
#define intToY(i) ((int) ((short) i))
|
||||
#else
|
||||
#define intToCoord(i,x,y) (((x) = (int) ((short) (i))), ((y) = GetHighWord(i)))
|
||||
#define coordToInt(x,y) (((y) << 16) | (x))
|
||||
#define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff))
|
||||
#define intToX(i) ((int) ((short) (i)))
|
||||
#define intToY(i) (GetHighWord(i))
|
||||
#endif
|
||||
@@ -60,10 +62,11 @@ void
|
||||
MFBFILLPOLY1RECT (pDrawable, pGC, shape, mode, count, ptsIn)
|
||||
DrawablePtr pDrawable;
|
||||
GCPtr pGC;
|
||||
int shape;
|
||||
int mode;
|
||||
int count;
|
||||
DDXPointPtr ptsIn;
|
||||
{
|
||||
mfbPrivGCPtr devPriv;
|
||||
int nlwidth;
|
||||
PixelType *addrl, *addr;
|
||||
int maxy;
|
||||
@@ -73,29 +76,28 @@ MFBFILLPOLY1RECT (pDrawable, pGC, shape, mode, count, ptsIn)
|
||||
BoxPtr extents;
|
||||
int clip;
|
||||
int y;
|
||||
int *vertex1p, *vertex2p;
|
||||
int *vertex1p = NULL, *vertex2p;
|
||||
int *endp;
|
||||
int x1, x2;
|
||||
int dx1, dx2;
|
||||
int dy1, dy2;
|
||||
int e1, e2;
|
||||
int step1, step2;
|
||||
int sign1, sign2;
|
||||
int x1 = 0, x2 = 0;
|
||||
int dx1 = 0, dx2 = 0;
|
||||
int dy1 = 0, dy2 = 0;
|
||||
int e1 = 0, e2 = 0;
|
||||
int step1 = 0, step2 = 0;
|
||||
int sign1 = 0, sign2 = 0;
|
||||
int h;
|
||||
int l, r;
|
||||
PixelType mask, bits = ~((PixelType)0);
|
||||
int nmiddle;
|
||||
|
||||
devPriv = (mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr);
|
||||
if (mode == CoordModePrevious || shape != Convex ||
|
||||
REGION_NUM_RECTS(devPriv->pCompositeClip) != 1)
|
||||
REGION_NUM_RECTS(pGC->pCompositeClip) != 1)
|
||||
{
|
||||
miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
|
||||
return;
|
||||
}
|
||||
origin = *((int *) &pDrawable->x);
|
||||
vertex2 = origin - ((origin & 0x8000) << 1);
|
||||
extents = &devPriv->pCompositeClip->extents;
|
||||
extents = &pGC->pCompositeClip->extents;
|
||||
vertex1 = *((int *) &extents->x1) - vertex2;
|
||||
vertex2 = *((int *) &extents->x2) - vertex2 - 0x00010001;
|
||||
clip = 0;
|
||||
@@ -135,7 +137,7 @@ MFBFILLPOLY1RECT (pDrawable, pGC, shape, mode, count, ptsIn)
|
||||
vertex2p = (int *) ptsIn;
|
||||
#define Setup(c,x,vertex,dx,dy,e,sign,step) {\
|
||||
x = intToX(vertex); \
|
||||
if (dy = intToY(c) - y) { \
|
||||
if ((dy = intToY(c) - y)) { \
|
||||
dx = intToX(c) - x; \
|
||||
step = 0; \
|
||||
if (dx >= 0) \
|
||||
@@ -239,7 +241,7 @@ MFBFILLPOLY1RECT (pDrawable, pGC, shape, mode, count, ptsIn)
|
||||
}
|
||||
nmiddle >>= PWSH;
|
||||
Duff (nmiddle, *addr++ EQWHOLEWORD)
|
||||
if (mask = ~SCRRIGHT(bits, r & PIM))
|
||||
if ((mask = ~SCRRIGHT(bits, r & PIM)))
|
||||
*addr OPEQ mask;
|
||||
}
|
||||
if (!--h)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbplygblt.c,v 3.4 2001/12/14 20:00:10 dawes Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -154,8 +155,7 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
bbox.y1 = y - info.overallAscent;
|
||||
bbox.y2 = y + info.overallDescent;
|
||||
|
||||
switch (RECT_IN_REGION(pGC->pScreen,
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip, &bbox))
|
||||
switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
|
||||
{
|
||||
case rgnOUT:
|
||||
break;
|
||||
@@ -172,7 +172,7 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
|
||||
|
||||
/* start at top scanline of glyph */
|
||||
pdst = mfbScanlineDelta(pdstBase, -pci->metrics.ascent, widthDst);
|
||||
pdst = pdstBase;
|
||||
|
||||
/* find correct word in scanline and x offset within it
|
||||
for left edge of glyph
|
||||
@@ -189,6 +189,8 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
pdst--;
|
||||
}
|
||||
|
||||
pdst = mfbScanlineDelta(pdst, -pci->metrics.ascent, widthDst);
|
||||
|
||||
if ((xoff + w) <= PPW)
|
||||
{
|
||||
/* glyph all in one longword */
|
||||
@@ -282,7 +284,7 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
}
|
||||
}
|
||||
|
||||
cclip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
cclip = pGC->pCompositeClip;
|
||||
pbox = REGION_RECTS(cclip);
|
||||
nbox = REGION_NUM_RECTS(cclip);
|
||||
|
||||
@@ -335,7 +337,7 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
pglyph = FONTGLYPHBITS(pglyphBase, pci);
|
||||
pglyph += (glyphRow * widthGlyph);
|
||||
|
||||
pdst = mfbScanlineDelta(ppos[i].pdstBase, -(y-topEdge), widthDst);
|
||||
pdst = ppos[i].pdstBase;
|
||||
|
||||
glyphCol = (leftEdge - ppos[i].xpos) -
|
||||
(pci->metrics.leftSideBearing);
|
||||
@@ -352,6 +354,8 @@ MFBPOLYGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
pdst--;
|
||||
}
|
||||
|
||||
pdst = mfbScanlineDelta(pdst, -(y-topEdge), widthDst);
|
||||
|
||||
if ((xoff + w) <= PPW)
|
||||
{
|
||||
maskpartialbits(xoff, w, startmask);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbpolypnt.c,v 1.5 2001/12/14 20:00:11 dawes Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -99,8 +100,8 @@ mfbPolyPoint(pDrawable, pGC, mode, npt, pptInit)
|
||||
}
|
||||
}
|
||||
|
||||
nbox = REGION_NUM_RECTS(pGCPriv->pCompositeClip);
|
||||
pbox = REGION_RECTS(pGCPriv->pCompositeClip);
|
||||
nbox = REGION_NUM_RECTS(pGC->pCompositeClip);
|
||||
pbox = REGION_RECTS(pGC->pCompositeClip);
|
||||
for (; --nbox >= 0; pbox++)
|
||||
{
|
||||
if (rop == RROP_BLACK)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbpushpxl.c,v 1.7 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -107,7 +108,7 @@ mfbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
|
||||
register BoxPtr pbox;
|
||||
int i;
|
||||
|
||||
if (!pGC->planemask & 1) return;
|
||||
if (!(pGC->planemask & 1)) return;
|
||||
|
||||
/* compute the reduced rop function */
|
||||
alu = pGC->alu;
|
||||
@@ -122,8 +123,7 @@ mfbSolidPP(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
|
||||
REGION_INIT(pGC->pScreen, &rgnDst, &srcBox, 1);
|
||||
|
||||
/* clip the shape of the dst to the destination composite clip */
|
||||
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip);
|
||||
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
|
||||
|
||||
if (!REGION_NIL(&rgnDst))
|
||||
{
|
||||
@@ -179,7 +179,7 @@ mfbPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
|
||||
for(h = 0; h < dy; h++)
|
||||
{
|
||||
|
||||
pw = (PixelType *)
|
||||
pw = (PixelType *)(pointer)
|
||||
(((char *)(pBitMap->devPrivate.ptr))+(h * pBitMap->devKind));
|
||||
pwLineStart = pw;
|
||||
/* Process all words which are fully in the pixmap */
|
||||
|
||||
@@ -45,12 +45,15 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbscrclse.c,v 1.4 2003/02/18 21:30:01 tsi Exp $ */
|
||||
|
||||
#include "mfb.h"
|
||||
#include "scrnintstr.h"
|
||||
|
||||
/*ARGSUSED*/
|
||||
Bool
|
||||
mfbCloseScreen(index, pScreen)
|
||||
int index;
|
||||
register ScreenPtr pScreen;
|
||||
{
|
||||
xfree(pScreen->devPrivate);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbscrinit.c,v 3.9 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
@@ -51,6 +52,7 @@ SOFTWARE.
|
||||
#include "Xmd.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "resource.h"
|
||||
#include "colormap.h"
|
||||
#include "mfb.h"
|
||||
@@ -82,12 +84,12 @@ static DepthRec depth = {
|
||||
|
||||
#ifndef LOWMEMFTPT
|
||||
|
||||
miBSFuncRec mfbBSFuncRec = {
|
||||
BSFuncRec mfbBSFuncRec = {
|
||||
mfbSaveAreas,
|
||||
mfbRestoreAreas,
|
||||
(void (*)()) 0,
|
||||
(PixmapPtr (*)()) 0,
|
||||
(PixmapPtr (*)()) 0,
|
||||
(BackingStoreSetClipmaskRgnProcPtr) 0,
|
||||
(BackingStoreGetImagePixmapProcPtr) 0,
|
||||
(BackingStoreGetSpansPixmapProcPtr) 0,
|
||||
};
|
||||
|
||||
#endif /* ifndef LOWMEMFTPT */
|
||||
@@ -103,8 +105,7 @@ mfbAllocatePrivates(pScreen, pWinIndex, pGCIndex)
|
||||
frameWindowPrivateIndex = AllocateWindowPrivateIndex();
|
||||
#endif
|
||||
mfbWindowPrivateIndex = AllocateWindowPrivateIndex();
|
||||
mfbGCPrivateIndex = AllocateGCPrivateIndex();
|
||||
miRegisterGCPrivateIndex(mfbGCPrivateIndex);
|
||||
mfbGCPrivateIndex = miAllocateGCPrivateIndex();
|
||||
visual.vid = FakeClientID(0);
|
||||
VID = visual.vid;
|
||||
mfbGeneration = serverGeneration;
|
||||
@@ -113,6 +114,8 @@ mfbAllocatePrivates(pScreen, pWinIndex, pGCIndex)
|
||||
*pWinIndex = mfbWindowPrivateIndex;
|
||||
if (pGCIndex)
|
||||
*pGCIndex = mfbGCPrivateIndex;
|
||||
pScreen->GetWindowPixmap = mfbGetWindowPixmap;
|
||||
pScreen->SetWindowPixmap = mfbSetWindowPixmap;
|
||||
return (AllocateWindowPrivate(pScreen, mfbWindowPrivateIndex,
|
||||
sizeof(mfbPrivWin)) &&
|
||||
AllocateGCPrivate(pScreen, mfbGCPrivateIndex, sizeof(mfbPrivGC)));
|
||||
@@ -156,11 +159,39 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
|
||||
pScreen->InstallColormap = mfbInstallColormap;
|
||||
pScreen->UninstallColormap = mfbUninstallColormap;
|
||||
pScreen->ListInstalledColormaps = mfbListInstalledColormaps;
|
||||
pScreen->StoreColors = (void (*)())NoopDDA;
|
||||
pScreen->StoreColors = (StoreColorsProcPtr)NoopDDA;
|
||||
pScreen->ResolveColor = mfbResolveColor;
|
||||
pScreen->BitmapToRegion = mfbPixmapToRegion;
|
||||
return miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
|
||||
1, 1, &depth, VID, 1, &visual, &mfbBSFuncRec);
|
||||
if (!miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
|
||||
1, 1, &depth, VID, 1, &visual))
|
||||
return FALSE;
|
||||
pScreen->BackingStoreFuncs = mfbBSFuncRec;
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* ifndef LOWMEMFTPT */
|
||||
|
||||
PixmapPtr
|
||||
mfbGetWindowPixmap(pWin)
|
||||
WindowPtr pWin;
|
||||
{
|
||||
#ifdef PIXMAP_PER_WINDOW
|
||||
return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
|
||||
#else
|
||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
|
||||
return (* pScreen->GetScreenPixmap)(pScreen);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
mfbSetWindowPixmap(pWin, pPix)
|
||||
WindowPtr pWin;
|
||||
PixmapPtr pPix;
|
||||
{
|
||||
#ifdef PIXMAP_PER_WINDOW
|
||||
pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
|
||||
#else
|
||||
(* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* ifndef LOWMEMFTPT */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbsetsp.c,v 1.7 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -69,6 +70,7 @@ SOFTWARE.
|
||||
* boxes, we may not want to start grabbing bits at psrc but at some offset
|
||||
* further on.)
|
||||
*/
|
||||
void
|
||||
mfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst)
|
||||
int y;
|
||||
int xOrigin; /* where this scanline starts */
|
||||
@@ -157,7 +159,7 @@ mfbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted)
|
||||
int nspans;
|
||||
int fSorted;
|
||||
{
|
||||
PixelType *psrc = (PixelType *)pcharsrc;
|
||||
PixelType *psrc = (PixelType *)(pointer)pcharsrc;
|
||||
PixelType *pdstBase; /* start of dst bitmap */
|
||||
int widthDst; /* width of bitmap in words */
|
||||
register BoxPtr pbox, pboxLast, pboxTest;
|
||||
@@ -168,7 +170,7 @@ mfbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted)
|
||||
int yMax;
|
||||
|
||||
alu = pGC->alu;
|
||||
prgnDst = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
prgnDst = pGC->pCompositeClip;
|
||||
|
||||
pptLast = ppt + nspans;
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbtegblt.c,v 1.8 2001/12/14 20:00:12 dawes Exp $ */
|
||||
|
||||
#include "X.h"
|
||||
#include "Xmd.h"
|
||||
#include "Xproto.h"
|
||||
@@ -99,84 +102,43 @@ two times:
|
||||
#define ShiftAmnt 16
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XXX XXX XXX There is something horribly, massively wrong here. There are
|
||||
* hardcoded shifts by 64 below; these cannot work on any present-day
|
||||
* architecture.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Note: for BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER, SCRRIGHT() evaluates its
|
||||
* first argument more than once. Thus the imbedded char++ have to be moved.
|
||||
* (DHD)
|
||||
*/
|
||||
#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
|
||||
#if PPW == 32
|
||||
#define GetBits4 c = (*char1++ << ShiftAmnt) | \
|
||||
SCRRIGHT (*char2++ << ShiftAmnt, xoff2) | \
|
||||
SCRRIGHT (*char3++ << ShiftAmnt, xoff3) | \
|
||||
SCRRIGHT (*char4++ << ShiftAmnt, xoff4);
|
||||
#else /* PPW */
|
||||
#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \
|
||||
(SCRRIGHT (*char2++ << ShiftAmnt, xoff2) << 32 ) | \
|
||||
(SCRRIGHT (*char3++ << ShiftAmnt, xoff3) << 32 ) | \
|
||||
(SCRRIGHT (*char4++ << ShiftAmnt, xoff4) << 32 ) | \
|
||||
(*char5++ << ShiftAmnt) | \
|
||||
SCRRIGHT (*char6++ << ShiftAmnt, xoff6) | \
|
||||
SCRRIGHT (*char7++ << ShiftAmnt, xoff7) | \
|
||||
SCRRIGHT (*char8++ << ShiftAmnt, xoff8);
|
||||
#endif /* PPW */
|
||||
#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
|
||||
#if PPW == 32
|
||||
#define GetBits4 c = (*char1++ << ShiftAmnt) | \
|
||||
SCRRIGHT (*char2 << ShiftAmnt, xoff2) | \
|
||||
SCRRIGHT (*char3 << ShiftAmnt, xoff3) | \
|
||||
SCRRIGHT (*char4 << ShiftAmnt, xoff4); \
|
||||
char2++; char3++; char4++;
|
||||
#else /* PPW == 64 */
|
||||
#define GetBits4 c = ((unsigned long)(*char1++ << ShiftAmnt) << 32 ) | \
|
||||
(SCRRIGHT (*char2 << ShiftAmnt, xoff2) << 32 ) | \
|
||||
(SCRRIGHT (*char3 << ShiftAmnt, xoff3) << 32 ) | \
|
||||
(SCRRIGHT (*char4 << ShiftAmnt, xoff4) << 32 ) | \
|
||||
(*char5++ << ShiftAmnt) | \
|
||||
SCRRIGHT (*char6 << ShiftAmnt, xoff6) | \
|
||||
SCRRIGHT (*char7 << ShiftAmnt, xoff7) | \
|
||||
SCRRIGHT (*char8 << ShiftAmnt, xoff8); \
|
||||
char2++; char3++; char4++; char6++; char7++; char8++;
|
||||
#endif /* PPW */
|
||||
#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
|
||||
|
||||
#else /* (BITMAP_BIT_ORDER != MSBFirst) || (GLYPHPADBYTES == 4) */
|
||||
|
||||
#if BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER
|
||||
#if PPW == 32
|
||||
#define GetBits4 c = *char1++ | \
|
||||
SCRRIGHT (*char2++, xoff2) | \
|
||||
SCRRIGHT (*char3++, xoff3) | \
|
||||
SCRRIGHT (*char4++, xoff4);
|
||||
#else /* PPW == 64 */
|
||||
#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \
|
||||
(SCRRIGHT (*char2++, xoff2) << 64 ) | \
|
||||
(SCRRIGHT (*char3++, xoff3) << 64 ) | \
|
||||
(SCRRIGHT (*char4++, xoff4) << 64 ) | \
|
||||
SCRRIGHT (*char5++, xoff5) | \
|
||||
SCRRIGHT (*char6++, xoff6) | \
|
||||
SCRRIGHT (*char7++, xoff7) | \
|
||||
SCRRIGHT (*char8++, xoff8));
|
||||
#endif /* PPW */
|
||||
#else /* BITMAP_BIT_ORDER != IMAGE_BYTE_ORDER */
|
||||
#if PPW == 32
|
||||
#define GetBits4 c = *char1++ | \
|
||||
SCRRIGHT (*char2, xoff2) | \
|
||||
SCRRIGHT (*char3, xoff3) | \
|
||||
SCRRIGHT (*char4, xoff4); \
|
||||
char2++; char3++; char4++;
|
||||
#else /* PPW == 64 */
|
||||
#define GetBits4 c = (unsigned long)(((*char1++) << 64 ) | \
|
||||
(SCRRIGHT (*char2, xoff2) << 64 ) | \
|
||||
(SCRRIGHT (*char3, xoff3) << 64 ) | \
|
||||
(SCRRIGHT (*char4, xoff4) << 64 ) | \
|
||||
SCRRIGHT (*char5, xoff5) | \
|
||||
SCRRIGHT (*char6, xoff6) | \
|
||||
SCRRIGHT (*char7, xoff7) | \
|
||||
SCRRIGHT (*char8, xoff8)); \
|
||||
char2++; char3++; char4++; \
|
||||
char5++; char6++; char7++; char8++;
|
||||
#endif /* PPW */
|
||||
#endif /* BITMAP_BIT_ORDER == IMAGE_BYTE_ORDER */
|
||||
|
||||
#endif /* BITMAP_BIT_ORDER && GLYPHPADBYTES */
|
||||
@@ -232,10 +194,6 @@ MFBTEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
register PixelType c;
|
||||
register int xoff1, xoff2, xoff3, xoff4;
|
||||
register glyphPointer char1, char2, char3, char4;
|
||||
#if PPW == 64
|
||||
register int xoff5, xoff6, xoff7, xoff8;
|
||||
register glyphPointer char5, char6, char7, char8;
|
||||
#endif /* PPW */
|
||||
|
||||
#ifdef USE_LEFTBITS
|
||||
register PixelType glyphMask;
|
||||
@@ -262,8 +220,7 @@ MFBTEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
bbox.y1 = ypos;
|
||||
bbox.y2 = ypos + h;
|
||||
|
||||
switch (RECT_IN_REGION(pGC->pScreen,
|
||||
((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip, &bbox))
|
||||
switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
|
||||
{
|
||||
case rgnPART:
|
||||
/* this is the WRONG thing to do, but it works.
|
||||
@@ -307,22 +264,10 @@ MFBTEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
xoff2 = widthGlyph;
|
||||
xoff3 = xoff2 + widthGlyph;
|
||||
xoff4 = xoff3 + widthGlyph;
|
||||
#if PPW == 64
|
||||
xoff5 = xoff4 + widthGlyph;
|
||||
xoff6 = xoff5 + widthGlyph;
|
||||
xoff7 = xoff6 + widthGlyph;
|
||||
xoff8 = xoff7 + widthGlyph;
|
||||
#endif /* PPW */
|
||||
char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
|
||||
char2 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
|
||||
char3 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
|
||||
char4 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
|
||||
#if PPW == 64
|
||||
char5 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
|
||||
char6 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
|
||||
char7 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
|
||||
char8 = (glyphPointer) FONTGLYPHBITS(pglyphBase,(*ppci++));
|
||||
#endif /* PPW */
|
||||
|
||||
hTmp = h;
|
||||
dst = mfbScanlineOffset(pdstBase, (xpos >> PWSH)); /* switch now */
|
||||
@@ -341,7 +286,7 @@ MFBTEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
# endif
|
||||
FASTPUTBITS(OP(c), xoff1, widthGlyphs, dst);
|
||||
#else
|
||||
*(dst) = (*dst) & ~startmask | OP(SCRRIGHT(c, xoff1)) & startmask;
|
||||
*(dst) = ((*dst) & ~startmask) | (OP(SCRRIGHT(c, xoff1)) & startmask);
|
||||
#endif
|
||||
mfbScanlineInc(dst, widthDst);
|
||||
}
|
||||
@@ -354,10 +299,10 @@ MFBTEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
while (hTmp--)
|
||||
{
|
||||
GetBits4
|
||||
dst[0] = dst[0] & ~startmask |
|
||||
OP(SCRRIGHT(c,xoff1)) & startmask;
|
||||
dst[1] = dst[1] & ~endmask |
|
||||
OP(SCRLEFT(c,nfirst)) & endmask;
|
||||
dst[0] = (dst[0] & ~startmask) |
|
||||
(OP(SCRRIGHT(c,xoff1)) & startmask);
|
||||
dst[1] = (dst[1] & ~endmask) |
|
||||
(OP(SCRLEFT(c,nfirst)) & endmask);
|
||||
mfbScanlineInc(dst, widthDst);
|
||||
}
|
||||
}
|
||||
@@ -393,7 +338,7 @@ MFBTEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
FASTPUTBITS (OP(c),xoff1,widthGlyph,dst);
|
||||
#else
|
||||
GetBits1
|
||||
(*dst) = (*dst) & ~startmask | OP(SCRRIGHT(c, xoff1)) & startmask;
|
||||
(*dst) = ((*dst) & ~startmask) | (OP(SCRRIGHT(c, xoff1)) & startmask);
|
||||
#endif
|
||||
mfbScanlineInc(dst, widthDst);
|
||||
}
|
||||
@@ -406,10 +351,10 @@ MFBTEGLYPHBLT(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
||||
while (hTmp--)
|
||||
{
|
||||
GetBits1
|
||||
dst[0] = dst[0] & ~startmask |
|
||||
OP(SCRRIGHT(c,xoff1)) & startmask;
|
||||
dst[1] = dst[1] & ~endmask |
|
||||
OP(SCRLEFT(c,nfirst)) & endmask;
|
||||
dst[0] = (dst[0] & ~startmask) |
|
||||
(OP(SCRRIGHT(c,xoff1)) & startmask);
|
||||
dst[1] = (dst[1] & ~endmask) |
|
||||
(OP(SCRLEFT(c,nfirst)) & endmask);
|
||||
mfbScanlineInc(dst, widthDst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbtile.c,v 1.3 2003/02/18 21:30:01 tsi Exp $ */
|
||||
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
|
||||
/***********************************************************
|
||||
|
||||
@@ -219,7 +220,7 @@ mfbTileAreaPPW (pDraw, nbox, pbox, alu, ptile)
|
||||
int alu;
|
||||
PixmapPtr ptile;
|
||||
{
|
||||
void (*f)(), mfbTileAreaPPWCopy(), mfbTileAreaPPWGeneral();
|
||||
void (*f)();
|
||||
|
||||
if (alu == GXcopy)
|
||||
f = mfbTileAreaPPWCopy;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* $XFree86: xc/programs/Xserver/mfb/mfbzerarc.c,v 3.7 2002/09/27 01:57:47 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
@@ -49,7 +50,7 @@ in this Software without prior written authorization from The Open Group.
|
||||
* LONG2CHARS() takes care of the re-ordering as required. (DHD)
|
||||
*/
|
||||
#if (BITMAP_BIT_ORDER == MSBFirst)
|
||||
#define LEFTMOST ((PixelType) LONG2CHARS((1 << PLST)))
|
||||
#define LEFTMOST ((PixelType) LONG2CHARS(((MfbBits)1 << PLST)))
|
||||
#else
|
||||
#define LEFTMOST ((PixelType) LONG2CHARS(1))
|
||||
#endif
|
||||
@@ -217,9 +218,9 @@ mfbZeroPolyArcSS(pDraw, pGC, narcs, parcs)
|
||||
int x2, y2;
|
||||
RegionPtr cclip;
|
||||
|
||||
if (!pGC->planemask & 1)
|
||||
if (!(pGC->planemask & 1))
|
||||
return;
|
||||
cclip = ((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->pCompositeClip;
|
||||
cclip = pGC->pCompositeClip;
|
||||
for (arc = parcs, i = narcs; --i >= 0; arc++)
|
||||
{
|
||||
if (miCanZeroArc(arc))
|
||||
|
||||
Reference in New Issue
Block a user