From: Timo Kreuzer Date: Fri, 25 Feb 2011 17:37:25 +0000 (+0000) Subject: [WIN32K] X-Git-Tag: ReactOS-0.3.13~141 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=25a9c6fb4948afe90b771b2b3d218ebf4d2ff332;hp=0fcd8261f2ee747c3b6eeb557b386cb9b873d5e7 [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. svn path=/trunk/; revision=50902 --- diff --git a/reactos/subsystems/win32/win32k/objects/bitmaps.c b/reactos/subsystems/win32/win32k/objects/bitmaps.c index 583b9514f4d..75e1b1c2be6 100644 --- a/reactos/subsystems/win32/win32k/objects/bitmaps.c +++ b/reactos/subsystems/win32/win32k/objects/bitmaps.c @@ -842,7 +842,7 @@ BITMAP_CopyBitmap(HBITMAP hBitmap) return 0; } - Bitmap = SURFACE_LockSurface(hBitmap); + Bitmap = SURFACE_ShareLockSurface(hBitmap); if (Bitmap == NULL) { return 0; @@ -867,11 +867,14 @@ BITMAP_CopyBitmap(HBITMAP hBitmap) 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 @@ BITMAP_CopyBitmap(HBITMAP hBitmap) } } - SURFACE_UnlockSurface(Bitmap); + SURFACE_ShareUnlockSurface(Bitmap); return res; }