[ros-diffs] [tkreuzer] 38511: Use the bitmap's palette, not the DC one's in NtGdiGetDIBitsInternal. Fixes Firefox colors going nots after 60 sec. See issue #3854 for more details.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Fri Jan 2 23:08:10 CET 2009


Author: tkreuzer
Date: Fri Jan  2 16:08:09 2009
New Revision: 38511

URL: http://svn.reactos.org/svn/reactos?rev=38511&view=rev
Log:
Use the bitmap's palette, not the DC one's in NtGdiGetDIBitsInternal. Fixes Firefox colors going nots after 60 sec.
See issue #3854 for more details.

Modified:
    trunk/reactos/subsystems/win32/win32k/objects/dibobj.c

Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/dibobj.c?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Fri Jan  2 16:08:09 2009
@@ -622,7 +622,6 @@
        return 0;
     }
 
-    /* Get handle for the palette in DC. */
     Dc = DC_LockDc(hDC);
     if (Dc == NULL) return 0;
     if (Dc->DC_Type == DC_TYPE_INFO)
@@ -630,14 +629,18 @@
         DC_UnlockDc(Dc);
         return 0;
     }
-    /* Source palette obtained from the windows hdc */
-    hSourcePalette = Dc->DcLevel.hpal;
     DC_UnlockDc(Dc);
 
     /* Get a pointer to the source bitmap object */
     BitmapObj = BITMAPOBJ_LockBitmap(hBitmap);
     if (BitmapObj == NULL)
        return 0;
+
+    hSourcePalette = BitmapObj->hDIBPalette;
+    if (!hSourcePalette)
+    {
+        hSourcePalette = pPrimarySurface->DevInfo.hpalDefault;
+    }
 
     ColorPtr = ((PBYTE)Info + Info->bmiHeader.biSize);
     rgbQuads = (RGBQUAD *)ColorPtr;



More information about the Ros-diffs mailing list