Author: gschneider
Date: Sat Sep 27 11:56:14 2008
New Revision: 36548
URL:
http://svn.reactos.org/svn/reactos?rev=36548&view=rev
Log:
Don't read and copy 32 Bit blocks, but only 24 Bit according to
24BPP_Put_/Get_Pixel.
Fixes NtGdiAlphaBlend in 24 Bit mode, see bug #3708.
Modified:
trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c
Modified: trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c [iso-8859-1] Sat Sep 27 11:56:14
2008
@@ -661,11 +661,14 @@
Alpha = ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0) ?
SrcPixel.col.alpha : BlendFunc.SourceConstantAlpha;
- DstPixel.ul = *Dst;
+ /* copy only 24bits of dst */
+ DstPixel.ul = *(PUSHORT)(Dst) + (*(Dst+2) << 16);
DstPixel.col.red = Clamp8(DstPixel.col.red * (255 - Alpha) / 255 +
SrcPixel.col.red);
DstPixel.col.green = Clamp8(DstPixel.col.green * (255 - Alpha) / 255 +
SrcPixel.col.green);
DstPixel.col.blue = Clamp8(DstPixel.col.blue * (255 - Alpha) / 255 +
SrcPixel.col.blue);
- *Dst = DstPixel.ul;
+ /* copy back 24bits of result */
+ *(PUSHORT)(Dst) = (USHORT)(DstPixel.ul & 0xFFFF);
+ *(Dst + 2) = (UCHAR)((DstPixel.ul >> 16) & 0xFF);
Dst = (PUCHAR)((ULONG_PTR)Dst + 3);
}
Dst = (PUCHAR)((ULONG_PTR)Dst + DstDelta);