Author: tkreuzer
Date: Fri Apr 15 15:29:08 2011
New Revision: 51352
URL:
http://svn.reactos.org/svn/reactos?rev=51352&view=rev
Log:
[WIN32K]
- Use shared locks for surfaces and palettes
Modified:
trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
trunk/reactos/subsystems/win32/win32k/objects/palette.c
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] Fri Apr 15 15:29:08
2011
@@ -743,7 +743,7 @@
if (pDC)
{
if (SetType == 1)
- {
+ {
if ( Set )
pDC->fs |= DC_FLAG_FULLSCREEN;
else
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Fri Apr 15
15:29:08 2011
@@ -934,24 +934,24 @@
/* Copy new IconInfo field */
CurIcon->IconInfo = IconInfo;
- psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor);
+ psurfBmp = SURFACE_ShareLockSurface(CurIcon->IconInfo.hbmColor);
if (psurfBmp)
{
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy;
- SURFACE_UnlockSurface(psurfBmp);
+ SURFACE_ShareUnlockSurface(psurfBmp);
GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL);
}
else
{
- psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmMask);
+ psurfBmp = SURFACE_ShareLockSurface(CurIcon->IconInfo.hbmMask);
if (!psurfBmp)
goto done;
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy / 2;
- SURFACE_UnlockSurface(psurfBmp);
+ SURFACE_ShareUnlockSurface(psurfBmp);
}
GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL);
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Fri Apr 15
15:29:08 2011
@@ -119,7 +119,7 @@
}
DecompressBitmap(sizl, pvCompressedBits, pvBits, lDelta, iFormat);
fjBitmap |= BMF_RLE_HACK;
-
+
iFormat = iFormat == BMF_4RLE ? BMF_4BPP : BMF_8BPP;
psurf->SurfObj.iBitmapFormat = iFormat;
}
@@ -201,7 +201,7 @@
if (pUnsafeBits && hbmp)
{
- PSURFACE psurf = SURFACE_LockSurface(hbmp);
+ PSURFACE psurf = SURFACE_ShareLockSurface(hbmp);
_SEH2_TRY
{
ProbeForRead(pUnsafeBits, cjSize, 1);
@@ -215,7 +215,7 @@
}
_SEH2_END
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
}
return hbmp;
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Fri Apr 15
15:29:08 2011
@@ -514,7 +514,7 @@
}
/* Lock the DIB palette */
- ppalDIB = PALETTE_LockPalette(hpalDIB);
+ ppalDIB = PALETTE_ShareLockPalette(hpalDIB);
if (!ppalDIB)
{
EngSetLastError(ERROR_INVALID_HANDLE);
@@ -555,7 +555,7 @@
ret = ScanLines;
}
- if (ppalDIB) PALETTE_UnlockPalette(ppalDIB);
+ if (ppalDIB) PALETTE_ShareUnlockPalette(ppalDIB);
if (pSourceSurf) EngUnlockSurface(pSourceSurf);
if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
@@ -1590,7 +1590,7 @@
EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
goto cleanup;
}
- bmp = SURFACE_LockSurface(res);
+ bmp = SURFACE_ShareLockSurface(res); // HACK
if (NULL == bmp)
{
DPRINT1("SURFACE_LockSurface failed\n");
@@ -1646,7 +1646,7 @@
if (bmp)
{
- SURFACE_UnlockSurface(bmp);
+ SURFACE_ShareUnlockSurface(bmp);
}
// Return BITMAP handle and storage location
Modified: trunk/reactos/subsystems/win32/win32k/objects/palette.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/palette.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/palette.c [iso-8859-1] Fri Apr 15
15:29:08 2011
@@ -469,11 +469,11 @@
return NULL;
}
- PalGDI = (PPALETTE) PALETTE_LockPalette(NewPalette);
+ PalGDI = (PPALETTE) PALETTE_ShareLockPalette(NewPalette);
if (PalGDI != NULL)
{
PALETTE_ValidateFlags(PalGDI->IndexedColors, PalGDI->NumColors);
- PALETTE_UnlockPalette(PalGDI);
+ PALETTE_ShareUnlockPalette(PalGDI);
}
else
{
@@ -664,7 +664,7 @@
if (NULL != dc)
{
HPALETTE hpal = dc->dclevel.hpal;
- palGDI = (PPALETTE) PALETTE_LockPalette(hpal);
+ palGDI = PALETTE_ShareLockPalette(hpal);
if (!palGDI)
{
DC_UnlockDc(dc);
@@ -691,7 +691,7 @@
(GetGValue(Color) >> GBits) << GBits,
(GetBValue(Color) >> BBits) << BBits);
}
- PALETTE_UnlockPalette(palGDI);
+ PALETTE_ShareUnlockPalette(palGDI);
DC_UnlockDc(dc);
}
@@ -704,7 +704,7 @@
HPALETTE hpal,
COLORREF crColor)
{
- PPALETTE ppal = (PPALETTE) PALETTE_LockPalette(hpal);
+ PPALETTE ppal = PALETTE_ShareLockPalette(hpal);
UINT index = 0;
if (ppal)
@@ -715,7 +715,7 @@
index = PALETTE_ulGetNearestPaletteIndex(ppal, crColor);
}
// else SetLastError ?
- PALETTE_UnlockPalette(ppal);
+ PALETTE_ShareUnlockPalette(ppal);
}
return index;
@@ -777,13 +777,13 @@
PWND Wnd;
const PALETTEENTRY *pptr = PaletteColors;
- palPtr = (PPALETTE)PALETTE_LockPalette(hPal);
+ palPtr = PALETTE_ShareLockPalette(hPal);
if (!palPtr) return FALSE;
pal_entries = palPtr->NumColors;
if (StartIndex >= pal_entries)
{
- PALETTE_UnlockPalette(palPtr);
+ PALETTE_ShareUnlockPalette(palPtr);
return FALSE;
}
if (StartIndex+NumEntries > pal_entries) NumEntries = pal_entries -
StartIndex;
@@ -800,7 +800,7 @@
}
}
- PALETTE_UnlockPalette(palPtr);
+ PALETTE_ShareUnlockPalette(palPtr);
/* Immediately apply the new palette if current window uses it */
Wnd = UserGetDesktopWindow();
@@ -831,7 +831,7 @@
PPALETTE palGDI;
UINT numEntries;
- palGDI = (PPALETTE) PALETTE_LockPalette(hpal);
+ palGDI = (PPALETTE) PALETTE_ShareLockPalette(hpal);
if (NULL == palGDI)
{
return 0;
@@ -846,7 +846,7 @@
}
if (numEntries <= StartIndex)
{
- PALETTE_UnlockPalette(palGDI);
+ PALETTE_ShareUnlockPalette(palGDI);
return 0;
}
memcpy(pe, palGDI->IndexedColors + StartIndex, Entries *
sizeof(PALETTEENTRY));
@@ -856,7 +856,7 @@
Entries = numEntries;
}
- PALETTE_UnlockPalette(palGDI);
+ PALETTE_ShareUnlockPalette(palGDI);
return Entries;
}
@@ -894,7 +894,7 @@
return 0;
}
- palGDI = PALETTE_LockPalette(dc->dclevel.hpal);
+ palGDI = PALETTE_ShareLockPalette(dc->dclevel.hpal);
if (palGDI != NULL)
{
if (pe != NULL)
@@ -917,7 +917,7 @@
}
if (palGDI != NULL)
- PALETTE_UnlockPalette(palGDI);
+ PALETTE_ShareUnlockPalette(palGDI);
if (dc != NULL)
DC_UnlockDc(dc);
@@ -941,13 +941,13 @@
return 0;
}
- palGDI = PALETTE_LockPalette(hpal);
+ palGDI = PALETTE_ShareLockPalette(hpal);
if (!palGDI) return 0;
numEntries = palGDI->NumColors;
if (Start >= numEntries)
{
- PALETTE_UnlockPalette(palGDI);
+ PALETTE_ShareUnlockPalette(palGDI);
return 0;
}
if (numEntries < Start + Entries)
@@ -955,7 +955,7 @@
Entries = numEntries - Start;
}
memcpy(palGDI->IndexedColors + Start, pe, Entries * sizeof(PALETTEENTRY));
- PALETTE_UnlockPalette(palGDI);
+ PALETTE_ShareUnlockPalette(palGDI);
return Entries;
}
@@ -1138,7 +1138,7 @@
!GDI_HANDLE_IS_TYPE(hgdiobj, GDI_OBJECT_TYPE_PALETTE) )
return Ret;
- palGDI = PALETTE_LockPalette(hgdiobj);
+ palGDI = PALETTE_ShareLockPalette(hgdiobj);
if (!palGDI) return FALSE;
// FIXME!!
@@ -1146,7 +1146,7 @@
// Zero out Current and Old Translated pointers?
//
Ret = TRUE;
- PALETTE_UnlockPalette(palGDI);
+ PALETTE_ShareUnlockPalette(palGDI);
return Ret;
}