[ros-diffs] [tkreuzer] 50902: [WIN32K] - In BITMAP_CopyBitmap, also "copy" the palette of the source bitmap, instead of assuming the one created by GreCreateBitmapEx matches the bitmap bits we have copied. Fix...

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Fri Feb 25 17:37:27 UTC 2011


Author: tkreuzer
Date: Fri Feb 25 17:37:25 2011
New Revision: 50902

URL: http://svn.reactos.org/svn/reactos?rev=50902&view=rev
Log:
[WIN32K]
- In BITMAP_CopyBitmap, also "copy" the palette of the source bitmap, instead of assuming the one created by GreCreateBitmapEx matches the bitmap bits we have copied.
Fixes broken colors on the firefox firstrun page
See issue #5902 for more details.

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

Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c?rev=50902&r1=50901&r2=50902&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Fri Feb 25 17:37:25 2011
@@ -842,7 +842,7 @@
         return 0;
     }
 
-    Bitmap = SURFACE_LockSurface(hBitmap);
+    Bitmap = SURFACE_ShareLockSurface(hBitmap);
     if (Bitmap == NULL)
     {
         return 0;
@@ -867,11 +867,14 @@
 
     if (res)
     {
-        resBitmap = SURFACE_LockSurface(res);
+        resBitmap = SURFACE_ShareLockSurface(res);
         if (resBitmap)
         {
             IntSetBitmapBits(resBitmap, Bitmap->SurfObj.cjBits, Bitmap->SurfObj.pvBits);
-			SURFACE_UnlockSurface(resBitmap);
+            GDIOBJ_IncrementShareCount(&Bitmap->ppal->BaseObject);
+            GDIOBJ_ShareUnlockObjByPtr(&resBitmap->ppal->BaseObject);
+            resBitmap->ppal = Bitmap->ppal;
+            SURFACE_ShareUnlockSurface(resBitmap);
         }
         else
         {
@@ -880,7 +883,7 @@
         }
     }
 
-    SURFACE_UnlockSurface(Bitmap);
+    SURFACE_ShareUnlockSurface(Bitmap);
 
     return  res;
 }




More information about the Ros-diffs mailing list