diff options
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c')
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c | 70 |
1 files changed, 43 insertions, 27 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c b/xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c index 3f8dea6f3..8797d53f2 100644 --- a/xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c +++ b/xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c,v 1.6 2000/03/03 18:49:55 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c,v 1.9 2000/06/29 10:55:41 alanh Exp $ */ #include "xaa.h" @@ -21,7 +21,7 @@ #endif #ifdef MSBFIRST -# define SOURCE(i) XAAReverseBitOrder(src[i]) +# define SOURCE(i) SWAP_BITS_IN_BYTES(src[i]) #else # define SOURCE(i) src[i] #endif @@ -35,15 +35,20 @@ BitmapScanline( CARD32 *src, CARD32 *base, int count, int skipleft ) { + CARD32 bits; + while(count >= 3) { - WRITE_BITS3(*src); + bits = *src; + WRITE_BITS3(bits); src++; count -= 3; } if (count == 2) { - WRITE_BITS2(*src); + bits = *src; + WRITE_BITS2(bits); } else if (count == 1) { - WRITE_BITS1(*src); + bits = *src; + WRITE_BITS1(bits); } return base; @@ -54,15 +59,20 @@ BitmapScanline_Inverted( CARD32 *src, CARD32 *base, int count, int skipleft ) { + CARD32 bits; + while(count >= 3) { - WRITE_BITS3(~(*src)); + bits = ~(*src); + WRITE_BITS3(bits); src++; count -= 3; } if (count == 2) { - WRITE_BITS2(~(*src)); + bits = ~(*src); + WRITE_BITS2(bits); } else if (count == 1) { - WRITE_BITS1(~(*src)); + bits = ~(*src); + WRITE_BITS1(bits); } return base; @@ -71,21 +81,23 @@ BitmapScanline_Inverted( static CARD32* BitmapScanline_Shifted( - CARD32 *bits, CARD32 *base, + CARD32 *src, CARD32 *base, int count, int skipleft ) { + CARD32 bits; + while(count >= 3) { - WRITE_BITS3((SHIFT_R(*bits,skipleft) | - SHIFT_L(*(bits + 1),(32 - skipleft)))); - bits++; + bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)); + WRITE_BITS3(bits); + src++; count -= 3; } if (count == 2) { - WRITE_BITS2((SHIFT_R(*bits,skipleft) | - SHIFT_L(*(bits + 1),(32 - skipleft)))); + bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)); + WRITE_BITS2(bits); } else if (count == 1) { - WRITE_BITS1((SHIFT_R(*bits,skipleft) | - SHIFT_L(*(bits + 1),(32 - skipleft)))); + bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)); + WRITE_BITS1(bits); } return base; @@ -93,21 +105,23 @@ BitmapScanline_Shifted( static CARD32* BitmapScanline_Shifted_Inverted( - CARD32 *bits, CARD32 *base, + CARD32 *src, CARD32 *base, int count, int skipleft ) { + CARD32 bits; + while(count >= 3) { - WRITE_BITS3(~(SHIFT_R(*bits,skipleft) | - SHIFT_L(*(bits + 1),(32 - skipleft)))); - bits++; + bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft))); + WRITE_BITS3(bits); + src++; count -= 3; } if (count == 2) { - WRITE_BITS2(~(SHIFT_R(*bits,skipleft) | - SHIFT_L(*(bits + 1),(32 - skipleft)))); + bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft))); + WRITE_BITS2(bits); } else if (count == 1) { - WRITE_BITS1(~(SHIFT_R(*bits,skipleft) | - SHIFT_L(*(bits + 1),(32 - skipleft)))); + bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft))); + WRITE_BITS1(bits); } return base; @@ -241,7 +255,7 @@ EXPNAME(XAAWriteBitmapColorExpand3)( EXPNAME(XAAWriteBitmapColorExpand)( #endif ScrnInfoPtr pScrn, - int x, int y, int w, int h, + int x, int y, int w, int H, unsigned char *src, int srcwidth, int skipleft, @@ -258,6 +272,7 @@ EXPNAME(XAAWriteBitmapColorExpand)( BitmapScanlineProcPtr firstFunc; BitmapScanlineProcPtr secondFunc; int flag; + int h = H; #ifdef TRIPLE_BITS if((bg != -1) && @@ -268,7 +283,7 @@ EXPNAME(XAAWriteBitmapColorExpand)( if((bg != -1) && (infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) { #endif - if(rop == GXcopy) { + if((rop == GXcopy) && infoRec->SetupForSolidFill) { (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask); (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h); } else SecondPassColor = bg; @@ -336,6 +351,7 @@ SECOND_PASS: } if(SecondPassColor != -1) { + h = H; /* Reset height */ fg = SecondPassColor; SecondPassColor = -1; firstFunc = secondFunc; @@ -383,7 +399,7 @@ EXPNAME(XAAWriteBitmapScanlineColorExpand)( if((bg != -1) && (infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)){ #endif - if(rop == GXcopy) { + if((rop == GXcopy) && infoRec->SetupForSolidFill) { (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask); (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h); } else SecondPassColor = bg; |