From 48150abcea0e37dad70236bcb021de27ea1d00fd Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 7 Jun 2008 00:51:38 +0000 Subject: [PATCH] BitBlt Make it act bit more like windows, use PatBlt instead for BitBlt for no ROP source for it bit faster Thx irc Goplat found my bug in the macro. svn path=/trunk/; revision=33876 --- reactos/dll/win32/gdi32/include/gdi32p.h | 3 +++ reactos/dll/win32/gdi32/objects/bitmap.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/reactos/dll/win32/gdi32/include/gdi32p.h b/reactos/dll/win32/gdi32/include/gdi32p.h index a5e6a9ebcd8..1f191748335 100644 --- a/reactos/dll/win32/gdi32/include/gdi32p.h +++ b/reactos/dll/win32/gdi32/include/gdi32p.h @@ -30,6 +30,9 @@ typedef INT #define METAFILE_MEMORY 1 #define METAFILE_DISK 2 +/* MACRO ********************************************************************/ +#define ROP_USES_SOURCE(Rop) ((Rop << 2) ^ Rop) & 0xCC0000 + /* TYPES *********************************************************************/ // Based on wmfapi.h and Wine. diff --git a/reactos/dll/win32/gdi32/objects/bitmap.c b/reactos/dll/win32/gdi32/objects/bitmap.c index 13e6741d0b4..21e89f53ab2 100644 --- a/reactos/dll/win32/gdi32/objects/bitmap.c +++ b/reactos/dll/win32/gdi32/objects/bitmap.c @@ -124,6 +124,9 @@ CreateDIBSection( return hBitmap; } + + + /* * @implemented */ @@ -139,6 +142,12 @@ BitBlt(HDC hdcDest, /* handle to destination DC */ int nYSrc, /* y-coordinate of source upper-left corner */ DWORD dwRop) /* raster operation code */ { + /* use patBlt for no source blt Like windows does */ + if (!ROP_USES_SOURCE(dwRop)) + { + return PatBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, dwRop); + } + return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest,