Author: fireball
Date: Thu Apr 2 21:43:24 2009
New Revision: 40332
URL:
http://svn.reactos.org/svn/reactos?rev=40332&view=rev
Log:
- Apply a fix by Timo Kreuzer for the bug spotted by Evgeniy Boltik. 4 failures less in
"gdi32_winetest.exe bitmap" now.
See issue #4326 for more details.
Modified:
trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c
Modified: trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/dib/dib1bpp.c [iso-8859-1] Thu Apr 2 21:43:24
2009
@@ -62,8 +62,11 @@
static
void
DIB_1BPP_BitBltSrcCopy_From1BPP (
- SURFOBJ* DestSurf, SURFOBJ* SourceSurf,
- PRECTL DestRect, POINTL *SourcePoint )
+ SURFOBJ* DestSurf,
+ SURFOBJ* SourceSurf,
+ XLATEOBJ* pxlo,
+ PRECTL DestRect,
+ POINTL *SourcePoint )
{
// the 'window' in this sense is the x-position that corresponds
// to the left-edge of the 8-pixel byte we are currently working with.
@@ -88,9 +91,9 @@
int dy2; // dest y end
int sy1; // src y start
- int dx;
+ int dx;
int shift;
- BYTE srcmask, dstmask;
+ BYTE srcmask, dstmask, xormask;
// 'd' and 's' are the dest & src buffer pointers that I use on my
x-sweep
// 'pd' and 'ps' are the dest & src buffer pointers used on the
inner y-sweep
@@ -98,6 +101,8 @@
PBYTE s, ps; // src ptrs
shift = (dl-sl)&7;
+
+ xormask = 0xFF * XLATEOBJ_iXlate(pxlo, 0);
if ( DestRect->top <= SourcePoint->y )
{
@@ -164,7 +169,7 @@
{
for ( ;; )
{
- *pd = (BYTE)((*pd & dstmask) | (*ps & srcmask));
+ *pd = (BYTE)((*pd & dstmask) | ((ps[0]^xormask) & srcmask));
// this *must* be here, because we could be going up *or* down...
if ( dy == dy2 )
@@ -179,7 +184,7 @@
for ( ;; )
{
*pd = (BYTE)((*pd & dstmask)
- | ( ( ps[1] >> shift ) & srcmask ));
+ | ( ( (ps[1]^xormask) >> shift ) & srcmask ));
// this *must* be here, because we could be going up *or* down...
if ( dy == dy2 )
@@ -194,7 +199,7 @@
for ( ;; )
{
*pd = (*pd & dstmask)
- | ( ( ps[0] << ( 8 - shift ) ) & srcmask );
+ | ( ( (ps[0]^xormask) << ( 8 - shift ) ) & srcmask );
// this *must* be here, because we could be going up *or* down...
if ( dy == dy2 )
@@ -209,7 +214,7 @@
for ( ;; )
{
*pd = (*pd & dstmask)
- | ( ( ( (ps[1])|(ps[0]<<8) ) >> shift ) & srcmask );
+ | ( ( ( ((ps[1]^xormask))|((ps[0]^xormask)<<8) ) >> shift ) &
srcmask );
// this *must* be here, because we could be going up *or* down...
if ( dy == dy2 )
@@ -239,7 +244,7 @@
switch ( BltInfo->SourceSurface->iBitmapFormat )
{
case BMF_1BPP:
- DIB_1BPP_BitBltSrcCopy_From1BPP ( BltInfo->DestSurface, BltInfo->SourceSurface,
&BltInfo->DestRect, &BltInfo->SourcePoint );
+ DIB_1BPP_BitBltSrcCopy_From1BPP ( BltInfo->DestSurface, BltInfo->SourceSurface,
BltInfo->XlateSourceToDest, &BltInfo->DestRect, &BltInfo->SourcePoint );
break;
case BMF_4BPP: