- Fixed bug in small width brush blts aligned to an eight boundary.

- Accelerate dstinvert blts (treat as patinvert with a colour of 0xF).

svn path=/trunk/; revision=5618
This commit is contained in:
David Welch 2003-08-17 15:11:54 +00:00
parent 6fba0a4d96
commit 8b7c8b8dff

View file

@ -187,14 +187,14 @@ VGADDI_BltBrush(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ MaskSurf,
PPOINTL SourcePoint, PPOINTL MaskPoint, PPOINTL SourcePoint, PPOINTL MaskPoint,
PBRUSHOBJ Brush, PPOINTL BrushPoint, ROP4 Rop4) PBRUSHOBJ Brush, PPOINTL BrushPoint, ROP4 Rop4)
{ {
UCHAR SolidColor; UCHAR SolidColor = 0;
ULONG Left; ULONG Left;
ULONG Right; ULONG Right;
ULONG Length; ULONG Length;
PUCHAR Video; PUCHAR Video;
UCHAR Mask; UCHAR Mask;
ULONG i, j; ULONG i, j;
ULONG RasterOp = 0; ULONG RasterOp = VGA_NORMAL;
/* Punt brush blts to non-device surfaces. */ /* Punt brush blts to non-device surfaces. */
if (Dest->iType != STYPE_DEVICE) if (Dest->iType != STYPE_DEVICE)
@ -203,30 +203,20 @@ VGADDI_BltBrush(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ MaskSurf,
} }
/* Punt pattern fills. */ /* Punt pattern fills. */
if ((Rop4 == PATCOPY || Rop4 == DSTINVERT) && if ((Rop4 == PATCOPY || Rop4 == PATINVERT) &&
Brush->iSolidColor == 0xFFFFFFFF) Brush->iSolidColor == 0xFFFFFFFF)
{ {
return(FALSE); return(FALSE);
} }
/* Get the brush colour. */ /* Get the brush colour. */
if (Rop4 == PATCOPY || Rop4 == PATINVERT) switch (Rop4)
{ {
SolidColor = Brush->iSolidColor; case PATCOPY: SolidColor = Brush->iSolidColor; break;
} case PATINVERT: SolidColor = Brush->iSolidColor; RasterOp = VGA_XOR; break;
else if (Rop4 == WHITENESS) case WHITENESS: SolidColor = 0xF; break;
{ case BLACKNESS: SolidColor = 0x0; break;
SolidColor = 0xF; case DSTINVERT: SolidColor = 0xF; RasterOp = VGA_XOR; break;
}
else
{
SolidColor = 0x0;
}
/* Get the raster op. */
if (Rop4 == PATINVERT)
{
RasterOp = 3;
} }
/* Select write mode 3. */ /* Select write mode 3. */
@ -243,7 +233,7 @@ VGADDI_BltBrush(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ MaskSurf,
/* Set up data rotate. */ /* Set up data rotate. */
WRITE_PORT_UCHAR((PUCHAR)GRA_I, 0x03); WRITE_PORT_UCHAR((PUCHAR)GRA_I, 0x03);
WRITE_PORT_UCHAR((PUCHAR)GRA_D, RasterOp << 3); WRITE_PORT_UCHAR((PUCHAR)GRA_D, RasterOp);
/* Fill any pixels on the left which don't fall into a full row of eight. */ /* Fill any pixels on the left which don't fall into a full row of eight. */
if ((DestRect->left % 8) != 0) if ((DestRect->left % 8) != 0)
@ -262,12 +252,12 @@ VGADDI_BltBrush(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ MaskSurf,
(VOID)READ_REGISTER_UCHAR(Video); (VOID)READ_REGISTER_UCHAR(Video);
WRITE_REGISTER_UCHAR(Video, Mask); WRITE_REGISTER_UCHAR(Video, Mask);
} }
}
/* Have we finished. */ /* Have we finished. */
if ((DestRect->right - DestRect->left) < (8 - (DestRect->left % 8))) if ((DestRect->right - DestRect->left) < (8 - (DestRect->left % 8)))
{ {
return(TRUE); return(TRUE);
}
} }
/* Fill any whole rows of eight pixels. */ /* Fill any whole rows of eight pixels. */
@ -412,6 +402,7 @@ DrvBitBlt(SURFOBJ *Dest,
case PATCOPY: case PATCOPY:
case WHITENESS: case WHITENESS:
case PATINVERT: case PATINVERT:
case DSTINVERT:
BltRectFunc = VGADDI_BltBrush; BltRectFunc = VGADDI_BltBrush;
break; break;