mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:46:38 +00:00
Fix mono -> color bitblts
svn path=/trunk/; revision=8345
This commit is contained in:
parent
60f5689a70
commit
d8b7c0ee97
1 changed files with 27 additions and 1 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: bitmaps.c,v 1.56 2004/02/20 07:45:58 royce Exp $ */
|
/* $Id: bitmaps.c,v 1.57 2004/02/23 22:44:52 gvg Exp $ */
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -61,6 +61,7 @@ BOOL STDCALL NtGdiBitBlt(HDC hDCDest,
|
||||||
PBRUSHOBJ BrushObj;
|
PBRUSHOBJ BrushObj;
|
||||||
BOOL UsesSource = ((ROP & 0xCC0000) >> 2) != (ROP & 0x330000);
|
BOOL UsesSource = ((ROP & 0xCC0000) >> 2) != (ROP & 0x330000);
|
||||||
BOOL UsesPattern = TRUE;//((ROP & 0xF00000) >> 4) != (ROP & 0x0F0000);
|
BOOL UsesPattern = TRUE;//((ROP & 0xF00000) >> 4) != (ROP & 0x0F0000);
|
||||||
|
HPALETTE Mono = NULL;
|
||||||
|
|
||||||
DCDest = DC_LockDc(hDCDest);
|
DCDest = DC_LockDc(hDCDest);
|
||||||
if (NULL == DCDest)
|
if (NULL == DCDest)
|
||||||
|
@ -196,17 +197,38 @@ BOOL STDCALL NtGdiBitBlt(HDC hDCDest,
|
||||||
PALETTE_UnlockPalette(DestPalette);
|
PALETTE_UnlockPalette(DestPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* KB41464 details how to convert between mono and color */
|
||||||
if (DCDest->w.bitsPerPixel == 1)
|
if (DCDest->w.bitsPerPixel == 1)
|
||||||
{
|
{
|
||||||
XlateObj = (PXLATEOBJ)IntEngCreateMonoXlate(SourceMode, DestPalette,
|
XlateObj = (PXLATEOBJ)IntEngCreateMonoXlate(SourceMode, DestPalette,
|
||||||
SourcePalette, DCSrc->w.backgroundColor);
|
SourcePalette, DCSrc->w.backgroundColor);
|
||||||
}
|
}
|
||||||
|
else if (UsesSource && 1 == DCSrc->w.bitsPerPixel)
|
||||||
|
{
|
||||||
|
ULONG Colors[2];
|
||||||
|
|
||||||
|
Colors[0] = DCSrc->w.textColor;
|
||||||
|
Colors[1] = DCSrc->w.backgroundColor;
|
||||||
|
Mono = EngCreatePalette(PAL_INDEXED, 2, Colors, 0, 0, 0);
|
||||||
|
if (NULL != Mono)
|
||||||
|
{
|
||||||
|
XlateObj = (PXLATEOBJ)IntEngCreateXlate(DestMode, PAL_INDEXED, DestPalette, Mono);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XlateObj = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
XlateObj = (PXLATEOBJ)IntEngCreateXlate(DestMode, SourceMode, DestPalette, SourcePalette);
|
XlateObj = (PXLATEOBJ)IntEngCreateXlate(DestMode, SourceMode, DestPalette, SourcePalette);
|
||||||
}
|
}
|
||||||
if (NULL == XlateObj)
|
if (NULL == XlateObj)
|
||||||
{
|
{
|
||||||
|
if (NULL != Mono)
|
||||||
|
{
|
||||||
|
EngDeletePalette(Mono);
|
||||||
|
}
|
||||||
if (UsesSource && hDCSrc != hDCDest)
|
if (UsesSource && hDCSrc != hDCDest)
|
||||||
{
|
{
|
||||||
DC_UnlockDc(hDCSrc);
|
DC_UnlockDc(hDCSrc);
|
||||||
|
@ -221,6 +243,10 @@ BOOL STDCALL NtGdiBitBlt(HDC hDCDest,
|
||||||
&DestRect, &SourcePoint, NULL, BrushObj, NULL, ROP);
|
&DestRect, &SourcePoint, NULL, BrushObj, NULL, ROP);
|
||||||
|
|
||||||
EngDeleteXlate(XlateObj);
|
EngDeleteXlate(XlateObj);
|
||||||
|
if (NULL != Mono)
|
||||||
|
{
|
||||||
|
EngDeletePalette(Mono);
|
||||||
|
}
|
||||||
if (UsesPattern)
|
if (UsesPattern)
|
||||||
{
|
{
|
||||||
BRUSHOBJ_UnlockBrush(DCDest->w.hBrush);
|
BRUSHOBJ_UnlockBrush(DCDest->w.hBrush);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue