diff --git a/subsystems/win32/win32k/objects/bitblt.c b/subsystems/win32/win32k/objects/bitblt.c index 052901ce072..5854743cdc6 100644 --- a/subsystems/win32/win32k/objects/bitblt.c +++ b/subsystems/win32/win32k/objects/bitblt.c @@ -328,7 +328,6 @@ NtGdiTransparentBlt( PGDIOBJ apObj[2]; RECTL rcDest, rcSrc; SURFACE *BitmapDest, *BitmapSrc = NULL; - PPALETTE PalSourceGDI; ULONG TransparentColor = 0; BOOL Ret = FALSE; EXLATEOBJ exlo; @@ -394,25 +393,10 @@ NtGdiTransparentBlt( goto done; } - if (BitmapSrc->ppal) - { - GDIOBJ_IncrementShareCount(&BitmapSrc->ppal->BaseObject); - PalSourceGDI = BitmapSrc->ppal ; - } - else - PalSourceGDI = PALETTE_ShareLockPalette(pPrimarySurface->devinfo.hpalDefault) ; - - if(!PalSourceGDI) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - goto done; - } - /* Translate Transparent (RGB) Color to the source palette */ - EXLATEOBJ_vInitialize(&exlo, &gpalRGB, PalSourceGDI, 0, 0, 0); + EXLATEOBJ_vInitialize(&exlo, &gpalRGB, BitmapSrc->ppal, 0, 0, 0); TransparentColor = XLATEOBJ_iXlate(&exlo.xlo, (ULONG)TransColor); EXLATEOBJ_vCleanup(&exlo); - PALETTE_ShareUnlockPalette(PalSourceGDI); EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest); diff --git a/subsystems/win32/win32k/objects/bitmaps.c b/subsystems/win32/win32k/objects/bitmaps.c index 163fda614a4..442a810d16d 100644 --- a/subsystems/win32/win32k/objects/bitmaps.c +++ b/subsystems/win32/win32k/objects/bitmaps.c @@ -430,7 +430,6 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos) BOOL bInRect = FALSE; SURFACE *psurf; SURFOBJ *pso; - PPALETTE ppal; EXLATEOBJ exlo; HBITMAP hBmpTmp; @@ -456,25 +455,8 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos) psurf = dc->dclevel.pSurface; if (psurf) { - pso = &psurf->SurfObj; - if (psurf->ppal) - { - ppal = psurf->ppal; - GDIOBJ_IncrementShareCount(&ppal->BaseObject); - } - else - ppal = PALETTE_ShareLockPalette(dc->ppdev->devinfo.hpalDefault); - - if (psurf->SurfObj.iBitmapFormat == BMF_1BPP && !psurf->hSecure) - { - /* FIXME: palette should be gpalMono already ! */ - EXLATEOBJ_vInitialize(&exlo, &gpalMono, &gpalRGB, 0, 0xffffff, 0); - } - else - { - EXLATEOBJ_vInitialize(&exlo, ppal, &gpalRGB, 0, 0xffffff, 0); - } - + pso = &psurf->SurfObj; + EXLATEOBJ_vInitialize(&exlo, psurf->ppal, &gpalRGB, 0, 0xffffff, 0); // check if this DC has a DIB behind it... if (pso->pvScan0) // STYPE_BITMAP == pso->iType { @@ -484,7 +466,6 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos) } EXLATEOBJ_vCleanup(&exlo); - PALETTE_ShareUnlockPalette(ppal); } } DC_UnlockDc(dc); diff --git a/subsystems/win32/win32k/objects/fillshap.c b/subsystems/win32/win32k/objects/fillshap.c index 51ddf3a2e0f..7779de4313f 100644 --- a/subsystems/win32/win32k/objects/fillshap.c +++ b/subsystems/win32/win32k/objects/fillshap.c @@ -1061,7 +1061,6 @@ NtGdiExtFloodFill( PDC dc; PDC_ATTR pdcattr; SURFACE *psurf = NULL; - PPALETTE ppal; EXLATEOBJ exlo; BOOL Ret = FALSE; RECTL DestRect; @@ -1106,16 +1105,7 @@ NtGdiExtFloodFill( goto cleanup; } - if (psurf->ppal) - { - ppal = psurf->ppal; - GDIOBJ_IncrementShareCount(&ppal->BaseObject); - } - else - // Destination palette obtained from the hDC - ppal = PALETTE_ShareLockPalette(dc->ppdev->devinfo.hpalDefault); - - EXLATEOBJ_vInitialize(&exlo, &gpalRGB, ppal, 0, 0xffffff, 0); + EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0xffffff, 0); /* Only solid fills supported for now * How to support pattern brushes and non standard surfaces (not offering dib functions): @@ -1125,7 +1115,6 @@ NtGdiExtFloodFill( Ret = DIB_XXBPP_FloodFillSolid(&psurf->SurfObj, &dc->eboFill.BrushObject, &DestRect, &Pt, ConvColor, FillType); EXLATEOBJ_vCleanup(&exlo); - PALETTE_ShareUnlockPalette(ppal); cleanup: DC_UnlockDc(dc); diff --git a/subsystems/win32/win32k/objects/freetype.c b/subsystems/win32/win32k/objects/freetype.c index 83f53fab758..11a92cf7670 100644 --- a/subsystems/win32/win32k/objects/freetype.c +++ b/subsystems/win32/win32k/objects/freetype.c @@ -3173,7 +3173,6 @@ GreExtTextOutW( BOOLEAN Render; POINT Start; BOOL DoBreak = FALSE; - PPALETTE ppalDst; USHORT DxShift; // TODO: Write test-cases to exactly match real Windows in different @@ -3443,21 +3442,10 @@ GreExtTextOutW( psurf = dc->dclevel.pSurface ; SurfObj = &psurf->SurfObj ; - /* Create the xlateobj */ - if (psurf->ppal) - { - ppalDst = psurf->ppal; - GDIOBJ_IncrementShareCount(&ppalDst->BaseObject); - } - else - // Destination palette obtained from the hDC - ppalDst = PALETTE_ShareLockPalette(dc->ppdev->devinfo.hpalDefault); - ASSERT(ppalDst); - EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, ppalDst, 0, 0, 0); - EXLATEOBJ_vInitialize(&exloDst2RGB, ppalDst, &gpalRGB, 0, 0, 0); - PALETTE_ShareUnlockPalette(ppalDst); + EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, psurf->ppal, 0, 0, 0); + EXLATEOBJ_vInitialize(&exloDst2RGB, psurf->ppal, &gpalRGB, 0, 0, 0); - if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ & DIRTY_BACKGROUND)) + if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ & DIRTY_BACKGROUND)) DC_vUpdateBackgroundBrush(dc) ; if(dc->pdcattr->ulDirty_ & DIRTY_TEXT)