From: Jérôme Gardou Date: Wed, 21 Apr 2010 15:52:52 +0000 (+0000) Subject: [WIN32K] X-Git-Tag: backups/reactos-yarotows@57446~145 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=ef35c1e75cff1e3c396a668e1e9ae4a68e090417 [WIN32K] - Use the attached surface bits depth when creating a compatible DC [USER32] - use a display DC for loading images svn path=/branches/reactos-yarotows/; revision=46981 --- diff --git a/dll/win32/user32/windows/bitmap.c b/dll/win32/user32/windows/bitmap.c index 41486c565f8..ab8f3e461fa 100644 --- a/dll/win32/user32/windows/bitmap.c +++ b/dll/win32/user32/windows/bitmap.c @@ -491,10 +491,10 @@ LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad) UnmapViewOfFile(BitmapInfo); return NULL; } - + /* FIXME: Handle color conversion and transparency. */ - hScreenDc = CreateCompatibleDC(NULL); + hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL); if (hScreenDc == NULL) { RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo); diff --git a/dll/win32/user32/windows/icon.c b/dll/win32/user32/windows/icon.c index b663dcc9407..cd9766a4f92 100644 --- a/dll/win32/user32/windows/icon.c +++ b/dll/win32/user32/windows/icon.c @@ -140,7 +140,7 @@ CreateIcon( ICONINFO IconInfo; IconInfo.fIcon = TRUE; - + if (cBitsPixel == 1) { nHeight <<= 1; @@ -159,7 +159,7 @@ CreateIcon( { IconInfo.hbmColor = CreateBitmap(nWidth, nHeight, cPlanes, cBitsPixel, XORbits); if(!IconInfo.hbmColor) - { + { DeleteObject(IconInfo.hbmMask); return (HICON)0; } @@ -260,9 +260,7 @@ CreateIconFromResourceEx( Data = (PBYTE)SafeIconImage + HeaderSize; /* get a handle to the screen dc, the icon we create is going to be compatable with this */ - // FIXME!!! This is a victim of the Win32k Initialization BUG!!!!! - //hScreenDc = CreateDCW(NULL, NULL, NULL, NULL); - hScreenDc = CreateCompatibleDC(NULL); + hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL); if (hScreenDc == NULL) { RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); diff --git a/subsystems/win32/win32k/objects/bitmaps.c b/subsystems/win32/win32k/objects/bitmaps.c index 25960d44467..bf063130f79 100644 --- a/subsystems/win32/win32k/objects/bitmaps.c +++ b/subsystems/win32/win32k/objects/bitmaps.c @@ -176,7 +176,7 @@ IntCreateCompatibleBitmap( Bmp = IntGdiCreateBitmap(abs(Width), abs(Height), dibs.dsBm.bmPlanes, - Dc->ppdev->gdiinfo.cBitsPixel,//<-- HACK! dibs.dsBm.bmBitsPixel, // <-- Correct! + dibs.dsBm.bmBitsPixel, NULL); } else @@ -665,7 +665,7 @@ VOID IntHandleSpecialColorType(HDC hDC, COLORREF* Color) switch (*Color >> 24) { case 0x10: /* DIBINDEX */ - if (IntGetDIBColorTable(hDC, LOWORD(*Color), 1, &quad) == 1) + if (IntGetDIBColorTable(hDC, LOWORD(*Color), 1, &quad) == 1) { *Color = RGB(quad.rgbRed, quad.rgbGreen, quad.rgbBlue); } @@ -707,7 +707,7 @@ VOID IntHandleSpecialColorType(HDC hDC, COLORREF* Color) default: DPRINT("Unsupported color type %d passed\n", *Color >> 24); break; - } + } } BOOL APIENTRY