[WIN32K]
authorJérôme Gardou <jerome.gardou@reactos.org>
Wed, 21 Apr 2010 15:52:52 +0000 (15:52 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Wed, 21 Apr 2010 15:52:52 +0000 (15:52 +0000)
  - 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

dll/win32/user32/windows/bitmap.c
dll/win32/user32/windows/icon.c
subsystems/win32/win32k/objects/bitmaps.c

index 41486c5..ab8f3e4 100644 (file)
@@ -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);
index b663dcc..cd9766a 100644 (file)
@@ -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);
index 25960d4..bf06313 100644 (file)
@@ -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