Author: fireball Date: Thu Mar 12 13:48:52 2009 New Revision: 39975
URL: http://svn.reactos.org/svn/reactos?rev=39975&view=rev Log: Evgeniy Boltik bstsoft@narod.ru - Use bitmap's DIB palette, if it exists. Fixes problems described in bug 4147. See issue #4147 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/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Thu Mar 12 13:48:52 2009 @@ -271,8 +271,17 @@ return 0; }
- // Destination palette obtained from the hDC - hDCPalette = PALETTE_LockPalette(((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault); + // Use hDIBPalette if it exists + if (bitmap->hDIBPalette) + { + DDB_Palette = bitmap->hDIBPalette; + } + else + { + // Destination palette obtained from the hDC + DDB_Palette = ((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault; + } + hDCPalette = PALETTE_LockPalette(DDB_Palette); if (NULL == hDCPalette) { EngUnlockSurface(SourceSurf); @@ -282,7 +291,6 @@ return 0; } DDB_Palette_Type = hDCPalette->Mode; - DDB_Palette = ((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault; PALETTE_UnlockPalette(hDCPalette);
// Source palette obtained from the BITMAPINFO