[ros-diffs] [jgardou] 46981: [WIN32K] - Use the attached surface bits depth when creating a compatible DC [USER32] - use a display DC for loading images

jgardou at svn.reactos.org jgardou at svn.reactos.org
Wed Apr 21 17:52:52 CEST 2010


Author: jgardou
Date: Wed Apr 21 17:52:52 2010
New Revision: 46981

URL: http://svn.reactos.org/svn/reactos?rev=46981&view=rev
Log:
[WIN32K]
  - Use the attached surface bits depth when creating a compatible DC
[USER32]
  - use a display DC for loading images

Modified:
    branches/reactos-yarotows/dll/win32/user32/windows/bitmap.c
    branches/reactos-yarotows/dll/win32/user32/windows/icon.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c

Modified: branches/reactos-yarotows/dll/win32/user32/windows/bitmap.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/dll/win32/user32/windows/bitmap.c?rev=46981&r1=46980&r2=46981&view=diff
==============================================================================
--- branches/reactos-yarotows/dll/win32/user32/windows/bitmap.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/dll/win32/user32/windows/bitmap.c [iso-8859-1] Wed Apr 21 17:52:52 2010
@@ -491,10 +491,10 @@
          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);

Modified: branches/reactos-yarotows/dll/win32/user32/windows/icon.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/dll/win32/user32/windows/icon.c?rev=46981&r1=46980&r2=46981&view=diff
==============================================================================
--- branches/reactos-yarotows/dll/win32/user32/windows/icon.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/dll/win32/user32/windows/icon.c [iso-8859-1] Wed Apr 21 17:52:52 2010
@@ -140,7 +140,7 @@
   ICONINFO IconInfo;
 
   IconInfo.fIcon = TRUE;
-  
+
   if (cBitsPixel == 1)
   {
     nHeight <<= 1;
@@ -159,7 +159,7 @@
   {
     IconInfo.hbmColor = CreateBitmap(nWidth, nHeight, cPlanes, cBitsPixel, XORbits);
     if(!IconInfo.hbmColor)
-    { 
+    {
        DeleteObject(IconInfo.hbmMask);
        return (HICON)0;
     }
@@ -260,9 +260,7 @@
   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);

Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c?rev=46981&r1=46980&r2=46981&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Wed Apr 21 17:52:52 2010
@@ -176,7 +176,7 @@
                     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 @@
     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 @@
         default:
             DPRINT("Unsupported color type %d passed\n", *Color >> 24);
             break;
-    }   
+    }
 }
 
 BOOL APIENTRY




More information about the Ros-diffs mailing list