From df807693a0bfd3a676b59700586b7911a809792d Mon Sep 17 00:00:00 2001 From: David Welch Date: Sun, 27 Jul 2003 18:37:23 +0000 Subject: [PATCH] - Pass the rop code to PatBlt down to the BitBlt functions. - Emulate all rop codes on dib 4bpp surfaces. I left the current code as an optimized case for SRCCOPY. svn path=/trunk/; revision=5292 --- reactos/subsys/win32k/dib/dib.h | 18 +- reactos/subsys/win32k/dib/dib16bpp.c | 9 +- reactos/subsys/win32k/dib/dib1bpp.c | 9 +- reactos/subsys/win32k/dib/dib24bpp.c | 9 +- reactos/subsys/win32k/dib/dib32bpp.c | 9 +- reactos/subsys/win32k/dib/dib4bpp.c | 236 +++++++++++++++++++++++++- reactos/subsys/win32k/dib/dib8bpp.c | 9 +- reactos/subsys/win32k/eng/bitblt.c | 16 +- reactos/subsys/win32k/eng/copybits.c | 8 +- reactos/subsys/win32k/eng/objects.h | 5 +- reactos/subsys/win32k/eng/surface.c | 5 +- reactos/subsys/win32k/objects/brush.c | 4 +- 12 files changed, 284 insertions(+), 53 deletions(-) diff --git a/reactos/subsys/win32k/dib/dib.h b/reactos/subsys/win32k/dib/dib.h index bb3cd5fd45c..81b49d41eb2 100644 --- a/reactos/subsys/win32k/dib/dib.h +++ b/reactos/subsys/win32k/dib/dib.h @@ -9,7 +9,8 @@ VOID DIB_1BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c); BOOLEAN DIB_1BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation); + PBRUSHOBJ Brush, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4); VOID DIB_4BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c); ULONG DIB_4BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y); @@ -18,7 +19,8 @@ VOID DIB_4BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c); BOOLEAN DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation); + PBRUSHOBJ Brush, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4); VOID DIB_8BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c); ULONG DIB_8BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y); @@ -27,7 +29,8 @@ VOID DIB_8BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c); BOOLEAN DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation); + PBRUSHOBJ Brush, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4); VOID DIB_16BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c); ULONG DIB_16BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y); @@ -36,7 +39,8 @@ VOID DIB_16BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c); BOOLEAN DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation); + PBRUSHOBJ Brush, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4); VOID DIB_24BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c); ULONG DIB_24BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y); @@ -45,7 +49,8 @@ VOID DIB_24BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c); BOOLEAN DIB_24BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation); + PBRUSHOBJ Brush, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4); VOID DIB_32BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c); ULONG DIB_32BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y); @@ -54,4 +59,5 @@ VOID DIB_32BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c); BOOLEAN DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation); + PBRUSHOBJ Brush, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4); diff --git a/reactos/subsys/win32k/dib/dib16bpp.c b/reactos/subsys/win32k/dib/dib16bpp.c index ab3d1d1a22f..78b14d43f64 100644 --- a/reactos/subsys/win32k/dib/dib16bpp.c +++ b/reactos/subsys/win32k/dib/dib16bpp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dib16bpp.c,v 1.4 2003/05/18 17:16:17 ea Exp $ */ +/* $Id: dib16bpp.c,v 1.5 2003/07/27 18:37:23 dwelch Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -77,9 +77,10 @@ DIB_16BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) BOOLEAN DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - SURFGDI *DestGDI, SURFGDI *SourceGDI, - PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation) + SURFGDI *DestGDI, SURFGDI *SourceGDI, + PRECTL DestRect, POINTL *SourcePoint, + PBRUSHOBJ BrushObj, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4) { LONG i, j, sx, sy, xColor, f1; PBYTE SourceBits, DestBits, SourceLine, DestLine; diff --git a/reactos/subsys/win32k/dib/dib1bpp.c b/reactos/subsys/win32k/dib/dib1bpp.c index 881e0cf0ac8..afa16577115 100644 --- a/reactos/subsys/win32k/dib/dib1bpp.c +++ b/reactos/subsys/win32k/dib/dib1bpp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dib1bpp.c,v 1.6 2003/05/18 17:16:17 ea Exp $ */ +/* $Id: dib1bpp.c,v 1.7 2003/07/27 18:37:23 dwelch Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -72,9 +72,10 @@ DIB_1BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) BOOLEAN DIB_1BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - SURFGDI *DestGDI, SURFGDI *SourceGDI, - PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation) + SURFGDI *DestGDI, SURFGDI *SourceGDI, + PRECTL DestRect, POINTL *SourcePoint, + PBRUSHOBJ BrushObj, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4) { LONG i, j, sx, sy = SourcePoint->y; diff --git a/reactos/subsys/win32k/dib/dib24bpp.c b/reactos/subsys/win32k/dib/dib24bpp.c index 7d332203ef8..e6723a63e30 100644 --- a/reactos/subsys/win32k/dib/dib24bpp.c +++ b/reactos/subsys/win32k/dib/dib24bpp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dib24bpp.c,v 1.11 2003/05/18 17:16:17 ea Exp $ */ +/* $Id: dib24bpp.c,v 1.12 2003/07/27 18:37:23 dwelch Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -77,9 +77,10 @@ DIB_24BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) BOOLEAN DIB_24BPP_BitBlt( SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - SURFGDI *DestGDI, SURFGDI *SourceGDI, - PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation) + SURFGDI *DestGDI, SURFGDI *SourceGDI, + PRECTL DestRect, POINTL *SourcePoint, + PBRUSHOBJ BrushObj, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4) { LONG i, j, sx, sy, xColor, f1; PBYTE SourceBits, DestBits, SourceLine, DestLine; diff --git a/reactos/subsys/win32k/dib/dib32bpp.c b/reactos/subsys/win32k/dib/dib32bpp.c index 78118a934f4..591e2d53e84 100644 --- a/reactos/subsys/win32k/dib/dib32bpp.c +++ b/reactos/subsys/win32k/dib/dib32bpp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dib32bpp.c,v 1.2 2003/05/18 17:16:17 ea Exp $ */ +/* $Id: dib32bpp.c,v 1.3 2003/07/27 18:37:23 dwelch Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -76,9 +76,10 @@ DIB_32BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) BOOLEAN DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - SURFGDI *DestGDI, SURFGDI *SourceGDI, - PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation) + SURFGDI *DestGDI, SURFGDI *SourceGDI, + PRECTL DestRect, POINTL *SourcePoint, + PBRUSHOBJ BrushObj, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4) { ULONG i, j, sx, sy, xColor, f1; PBYTE SourceBits, DestBits, SourceLine, DestLine; diff --git a/reactos/subsys/win32k/dib/dib4bpp.c b/reactos/subsys/win32k/dib/dib4bpp.c index 6ea980a1d51..ae953744d6b 100644 --- a/reactos/subsys/win32k/dib/dib4bpp.c +++ b/reactos/subsys/win32k/dib/dib4bpp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dib4bpp.c,v 1.14 2003/07/14 17:34:52 gvg Exp $ */ +/* $Id: dib4bpp.c,v 1.15 2003/07/27 18:37:23 dwelch Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -71,13 +71,150 @@ DIB_4BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) } } -BOOLEAN -DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - SURFGDI *DestGDI, SURFGDI *SourceGDI, - PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation) +ULONG +DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern) { - LONG i, j, sx, sy, f1, f2, xColor; + ULONG ResultNibble; + ULONG Result; + ULONG i; + static const ULONG ExpandDest[16] = + { + 0x55555555 /* 0000 */, + 0x555555AA /* 0001 */, + 0x5555AA55 /* 0010 */, + 0x5555AAAA /* 0011 */, + 0x55AA5555 /* 0100 */, + 0x55AA55AA /* 0101 */, + 0x55AAAA55 /* 0110 */, + 0x55AAAAAA /* 0111 */, + 0xAA555555 /* 1000 */, + 0xAA5555AA /* 1001 */, + 0xAA55AA55 /* 1010 */, + 0xAA55AAAA /* 1011 */, + 0xAAAA5555 /* 1100 */, + 0xAAAA55AA /* 1101 */, + 0xAAAAAA55 /* 1110 */, + 0xAAAAAAAA /* 1111 */, + }; + static const ULONG ExpandSource[16] = + { + 0x33333333 /* 0000 */, + 0x333333CC /* 0001 */, + 0x3333CC33 /* 0010 */, + 0x3333CCCC /* 0011 */, + 0x33CC3333 /* 0100 */, + 0x33CC33CC /* 0101 */, + 0x33CCCC33 /* 0110 */, + 0x33CCCCCC /* 0111 */, + 0xCC333333 /* 1000 */, + 0xCC3333CC /* 1001 */, + 0xCC33CC33 /* 1010 */, + 0xCC33CCCC /* 1011 */, + 0xCCCC3333 /* 1100 */, + 0xCCCC33CC /* 1101 */, + 0xCCCCCC33 /* 1110 */, + 0xCCCCCCCC /* 1111 */, + }; + static const ULONG ExpandPattern[16] = + { + 0x0F0F0F0F /* 0000 */, + 0x0F0F0FF0 /* 0001 */, + 0x0F0FF00F /* 0010 */, + 0x0F0FF0F0 /* 0011 */, + 0x0FF00F0F /* 0100 */, + 0x0FF00FF0 /* 0101 */, + 0x0FF0F00F /* 0110 */, + 0x0FF0F0F0 /* 0111 */, + 0xF00F0F0F /* 1000 */, + 0xF00F0FF0 /* 1001 */, + 0xF00FF00F /* 1010 */, + 0xF00FF0F0 /* 1011 */, + 0xF0F00F0F /* 1100 */, + 0xF0F00FF0 /* 1101 */, + 0xF0F0F00F /* 1110 */, + 0xF0F0F0F0 /* 1111 */, + }; + + /* Optimized code for the various named rop codes. */ + switch (Rop) + { + case BLACKNESS: return(0); + case NOTSRCERASE: return(~(Dest | Source)); + case NOTSRCCOPY: return(~Source); + case SRCERASE: return((~Dest) & Source); + case DSTINVERT: return(~Dest); + case PATINVERT: return(Dest ^ Pattern); + case SRCINVERT: return(Dest ^ Source); + case SRCAND: return(Dest & Source); + case MERGEPAINT: return(Dest & (~Source)); + case SRCPAINT: return(Dest | Source); + case MERGECOPY: return(Source & Pattern); + case SRCCOPY: return(Source); + case PATCOPY: return(Pattern); + case PATPAINT: return(Dest | (~Source) | Pattern); + case WHITENESS: return(0xFFFFFFFF); + } + /* Expand the ROP operation to all four bytes */ + Rop &= 0x00FF0000; + Rop = (Rop << 8) | (Rop) | (Rop >> 8) | (Rop >> 16); + /* Do the operation on four bits simultaneously. */ + Result = 0; + for (i = 0; i < 8; i++) + { + ResultNibble = Rop & ExpandDest[Dest & 0xF] & ExpandSource[Source & 0xF] & ExpandPattern[Pattern & 0xF]; + Result |= (((ResultNibble & 0xFF000000) ? 0x8 : 0x0) | ((ResultNibble & 0x00FF0000) ? 0x4 : 0x0) | + ((ResultNibble & 0x0000FF00) ? 0x2 : 0x0) | ((ResultNibble & 0x000000FF) ? 0x1 : 0x0)) << (i * 4); + Dest >>= 4; + Source >>= 4; + Pattern >>= 4; + } + return(Result); +} + +ULONG +DIB_4BPP_GetSource(SURFOBJ* SourceSurf, SURFGDI* SourceGDI, ULONG sx, ULONG sy, XLATEOBJ* ColorTranslation) +{ + switch (SourceGDI->BitsPerPixel) + { + case 1: + if (DIB_1BPP_GetPixel(SourceSurf, sx, sy)) + { + return(XLATEOBJ_iXlate(ColorTranslation, 0)); + } + else + { + return(XLATEOBJ_iXlate(ColorTranslation, 1)); + } + case 4: + if (ColorTranslation != NULL) + { + return(XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy))); + } + else + { + return(DIB_4BPP_GetPixel(SourceSurf, sx, sy)); + } + case 8: + return(XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy))); + case 16: + return(XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy))); + case 24: + return(XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy))); + case 32: + return(XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy))); + default: + DbgPrint("DIB_4BPP_ExpandSource: Unhandled number of bits per pixel in source.\n"); + return(0); + } +} + +BOOLEAN STATIC +DIB_4BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, + SURFGDI *DestGDI, SURFGDI *SourceGDI, + PRECTL DestRect, POINTL *SourcePoint, + XLATEOBJ* ColorTranslation) +{ + LONG i, j, sx, sy, f2, xColor; PBYTE SourceBits_24BPP, SourceLine_24BPP; PBYTE DestBits, DestLine, SourceBits_8BPP, SourceLine_8BPP; PBYTE SourceBits, SourceLine; @@ -229,7 +366,92 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DbgPrint("DIB_4BPP_Bitblt: Unhandled Source BPP: %u\n", SourceGDI->BitsPerPixel); return FALSE; } + return(TRUE); +} +BOOLEAN +DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, + SURFGDI *DestGDI, SURFGDI *SourceGDI, + PRECTL DestRect, POINTL *SourcePoint, + PBRUSHOBJ Brush, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4) +{ + LONG i, j, k, sx, sy; + ULONG Dest, Source, Pattern; + PULONG DestBits; + BOOL UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); + BOOL UsesPattern = ((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000); + ULONG RoundedRight = ((DestRect->right + 0x7) & ~0x7); + static const ULONG ExpandSolidColor[16] = + { + 0x00000000 /* 0 */, + 0x11111111 /* 1 */, + 0x22222222 /* 2 */, + 0x33333333 /* 3 */, + 0x44444444 /* 4 */, + 0x55555555 /* 5 */, + 0x66666666 /* 6 */, + 0x77777777 /* 7 */, + 0x88888888 /* 8 */, + 0x99999999 /* 9 */, + 0xAAAAAAAA /* 10 */, + 0xBBBBBBBB /* 11 */, + 0xCCCCCCCC /* 12 */, + 0xDDDDDDDD /* 13 */, + 0xEEEEEEEE /* 14 */, + 0xFFFFFFFF /* 15 */, + }; + + if (Rop4 == SRCCOPY) + { + return(DIB_4BPP_BitBltSrcCopy(DestSurf, SourceSurf, DestGDI, SourceGDI, DestRect, SourcePoint, ColorTranslation)); + } + else + { + sy = SourcePoint->y; + + for (j=DestRect->top; jbottom; j++) + { + sx = SourcePoint->x; + DestBits = (PULONG)(DestSurf->pvScan0 + (DestRect->left>>1) + j * DestSurf->lDelta); + for (i=DestRect->left; iiSolidColor & 0xF]; + } + *DestBits = DIB_DoRop(Rop4, Dest, Source, Pattern); + } + if (i < DestRect->right) + { + Dest = *DestBits; + for (; i < DestRect->right; i++) + { + if (UsesSource) + { + Source = DIB_4BPP_GetSource(SourceSurf, SourceGDI, sx + i, sy, ColorTranslation); + } + if (UsesPattern) + { + /* FIXME: No support for pattern brushes. */ + Pattern = ExpandSolidColor[Brush->iSolidColor & 0xF]; + } + DIB_4BPP_PutPixel(DestSurf, i, j, DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xF); + Dest >>= 4; + } + } + } + } return TRUE; } /* EOF */ diff --git a/reactos/subsys/win32k/dib/dib8bpp.c b/reactos/subsys/win32k/dib/dib8bpp.c index 442d44907df..eb70baeefe9 100644 --- a/reactos/subsys/win32k/dib/dib8bpp.c +++ b/reactos/subsys/win32k/dib/dib8bpp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dib8bpp.c,v 1.2 2003/05/18 17:16:17 ea Exp $ */ +/* $Id: dib8bpp.c,v 1.3 2003/07/27 18:37:23 dwelch Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -74,9 +74,10 @@ DIB_8BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) BOOLEAN DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, - SURFGDI *DestGDI, SURFGDI *SourceGDI, - PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation) + SURFGDI *DestGDI, SURFGDI *SourceGDI, + PRECTL DestRect, POINTL *SourcePoint, + PBRUSHOBJ BrushObj, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4) { ULONG i, j, sx, sy, xColor, f1; PBYTE SourceBits, DestBits, SourceLine, DestLine; diff --git a/reactos/subsys/win32k/eng/bitblt.c b/reactos/subsys/win32k/eng/bitblt.c index ecd490536a2..82922d2be3a 100644 --- a/reactos/subsys/win32k/eng/bitblt.c +++ b/reactos/subsys/win32k/eng/bitblt.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: bitblt.c,v 1.23 2003/07/11 15:59:37 royce Exp $ +/* $Id: bitblt.c,v 1.24 2003/07/27 18:37:23 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -175,7 +175,7 @@ CallDibBitBlt(PSURFOBJ OutputObj, PPOINTL BrushOrigin, ROP4 Rop4) { - return OutputGDI->DIB_BitBlt(OutputObj, InputObj, OutputGDI, InputGDI, OutputRect, InputPoint, ColorTranslation); + return OutputGDI->DIB_BitBlt(OutputObj, InputObj, OutputGDI, InputGDI, OutputRect, InputPoint, Brush, BrushOrigin, ColorTranslation, Rop4); } INT abs(INT nm); @@ -249,6 +249,10 @@ EngBitBlt(SURFOBJ *DestObj, { InputGDI = (PSURFGDI) AccessInternalObjectFromUserObject(InputObj); } + else + { + InputGDI = NULL; + } OutputRect = *DestRect; if (NULL != ClipRegion) @@ -301,14 +305,6 @@ EngBitBlt(SURFOBJ *DestObj, OutputGDI = (PSURFGDI)AccessInternalObjectFromUserObject(OutputObj); } - /* FIXME The code currently assumes there will be a source bitmap. This is not true when, for example, using this function to - * paint a brush pattern on the destination. */ - if (NULL == InputObj && 0xaacc != Rop4 && PATCOPY != Rop4) - { - DbgPrint("EngBitBlt: A source is currently required, even though not all operations require one (FIXME)\n"); - return FALSE; - } - // Determine clipping type if (ClipRegion == (CLIPOBJ *) NULL) { diff --git a/reactos/subsys/win32k/eng/copybits.c b/reactos/subsys/win32k/eng/copybits.c index 53d6a18773c..a13f3edee34 100644 --- a/reactos/subsys/win32k/eng/copybits.c +++ b/reactos/subsys/win32k/eng/copybits.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: copybits.c,v 1.15 2003/07/11 15:59:37 royce Exp $ +/* $Id: copybits.c,v 1.16 2003/07/27 18:37:23 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -129,7 +129,7 @@ EngCopyBits(SURFOBJ *Dest, switch(clippingType) { case DC_TRIVIAL: - DestGDI->DIB_BitBlt(Dest, Source, DestGDI, SourceGDI, DestRect, SourcePoint, ColorTranslation); + DestGDI->DIB_BitBlt(Dest, Source, DestGDI, SourceGDI, DestRect, SourcePoint, NULL, NULL, ColorTranslation, SRCCOPY); MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); @@ -143,7 +143,7 @@ EngCopyBits(SURFOBJ *Dest, ptlTmp.x = SourcePoint->x + rclTmp.left - DestRect->left; ptlTmp.y = SourcePoint->y + rclTmp.top - DestRect->top; - DestGDI->DIB_BitBlt(Dest, Source, DestGDI, SourceGDI, &rclTmp, &ptlTmp, ColorTranslation); + DestGDI->DIB_BitBlt(Dest, Source, DestGDI, SourceGDI, &rclTmp, &ptlTmp, NULL, NULL, ColorTranslation, SRCCOPY); MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); @@ -169,7 +169,7 @@ EngCopyBits(SURFOBJ *Dest, ptlTmp.y = SourcePoint->y + prcl->top - DestRect->top; if(!DestGDI->DIB_BitBlt(Dest, Source, DestGDI, SourceGDI, - prcl, &ptlTmp, ColorTranslation)) return FALSE; + prcl, &ptlTmp, NULL, NULL, ColorTranslation, SRCCOPY)) return FALSE; prcl++; diff --git a/reactos/subsys/win32k/eng/objects.h b/reactos/subsys/win32k/eng/objects.h index d26fe681d7b..f360be2678a 100644 --- a/reactos/subsys/win32k/eng/objects.h +++ b/reactos/subsys/win32k/eng/objects.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: objects.h,v 1.15 2003/05/18 17:16:17 ea Exp $ +/* $Id: objects.h,v 1.16 2003/07/27 18:37:23 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -167,7 +167,8 @@ typedef VOID (*PFN_DIB_VLine) (PSURFOBJ, LONG, LONG, LONG, ULONG); typedef BOOLEAN (*PFN_DIB_BitBlt) (PSURFOBJ DestSurf, PSURFOBJ SourceSurf, PSURFGDI DestGDI, PSURFGDI SourceGDI, PRECTL DestRect, PPOINTL SourcePoint, - XLATEOBJ *ColorTranslation); + PBRUSHOBJ BrushObj, PPOINTL BrushOrigin, + XLATEOBJ *ColorTranslation, ULONG Rop4); typedef struct _SURFGDI { ENGOBJ Header; diff --git a/reactos/subsys/win32k/eng/surface.c b/reactos/subsys/win32k/eng/surface.c index abe01dcb1f7..fbb504d8717 100644 --- a/reactos/subsys/win32k/eng/surface.c +++ b/reactos/subsys/win32k/eng/surface.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: surface.c,v 1.20 2003/07/11 15:59:37 royce Exp $ +/* $Id: surface.c,v 1.21 2003/07/27 18:37:23 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -98,7 +98,8 @@ static VOID Dummy_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c) static BOOLEAN Dummy_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFGDI *DestGDI, SURFGDI *SourceGDI, PRECTL DestRect, POINTL *SourcePoint, - XLATEOBJ *ColorTranslation) + PBRUSHOBJ BrushObj, POINTL* BrushOrign, + XLATEOBJ *ColorTranslation, ULONG Rop4) { return FALSE; } diff --git a/reactos/subsys/win32k/objects/brush.c b/reactos/subsys/win32k/objects/brush.c index d88b0e499e5..eeea50c0b6d 100644 --- a/reactos/subsys/win32k/objects/brush.c +++ b/reactos/subsys/win32k/objects/brush.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: brush.c,v 1.21 2003/06/28 08:39:18 gvg Exp $ +/* $Id: brush.c,v 1.22 2003/07/27 18:37:23 dwelch Exp $ */ @@ -252,7 +252,7 @@ BOOL STDCALL W32kPatBlt(HDC hDC, NULL, BrushObj, NULL, - PATCOPY); + ROP); } GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC ); DC_ReleasePtr( hDC );