Author: tkreuzer
Date: Mon Apr 18 19:09:05 2011
New Revision: 51392
URL:
http://svn.reactos.org/svn/reactos?rev=51392&view=rev
Log:
[WIN32K]
- Use shared locks for surfaces and palettes
Modified:
trunk/reactos/subsystems/win32/win32k/eng/bitblt.c
trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c
trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c
trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c
trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
trunk/reactos/subsystems/win32/win32k/objects/icm.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] Mon Apr 18 19:09:05
2011
@@ -66,7 +66,7 @@
pebo = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
hbmPattern = EBRUSHOBJ_pvGetEngBrush(pebo);
- psurfPattern = SURFACE_LockSurface(hbmPattern);
+ psurfPattern = SURFACE_ShareLockSurface(hbmPattern);
if (psurfPattern != NULL)
{
psoPattern = &psurfPattern->SurfObj;
@@ -168,7 +168,7 @@
}
if (psurfPattern)
- SURFACE_UnlockSurface(psurfPattern);
+ SURFACE_ShareUnlockSurface(psurfPattern);
return TRUE;
}
@@ -230,7 +230,7 @@
{
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
hbmPattern = EBRUSHOBJ_pvGetEngBrush(GdiBrush);
- psurfPattern = SURFACE_LockSurface(hbmPattern);
+ psurfPattern = SURFACE_ShareLockSurface(hbmPattern);
if (psurfPattern)
{
BltInfo.PatternSurface = &psurfPattern->SurfObj;
@@ -250,7 +250,7 @@
/* Pattern brush */
if (psurfPattern)
{
- SURFACE_UnlockSurface(psurfPattern);
+ SURFACE_ShareUnlockSurface(psurfPattern);
}
return Result;
Modified: trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/stretchblt.c [iso-8859-1] Mon Apr 18
19:09:05 2011
@@ -55,7 +55,7 @@
{
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
hbmPattern = EBRUSHOBJ_pvGetEngBrush(GdiBrush);
- psurfPattern = SURFACE_LockSurface(hbmPattern);
+ psurfPattern = SURFACE_ShareLockSurface(hbmPattern);
if (psurfPattern)
{
PatternSurface = &psurfPattern->SurfObj;
@@ -78,7 +78,7 @@
/* Pattern brush */
if (psurfPattern)
{
- SURFACE_UnlockSurface(psurfPattern);
+ SURFACE_ShareUnlockSurface(psurfPattern);
}
return bResult;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c [iso-8859-1] Mon Apr 18
19:09:05 2011
@@ -984,11 +984,11 @@
hdc = UserGetDCEx(NULL, NULL, DCX_USESTYLE);
- psurf = SURFACE_LockSurface(hMem);
+ psurf = SURFACE_ShareLockSurface(hMem);
BITMAP_GetObject(psurf, sizeof(BITMAP), (PVOID)&bm);
if(psurf)
{
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
}
bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
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] Mon Apr 18
19:09:05 2011
@@ -508,11 +508,11 @@
{
PSURFACE psurfBmp;
- psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor);
+ psurfBmp = SURFACE_ShareLockSurface(CurIcon->IconInfo.hbmColor);
if (psurfBmp)
{
colorBpp = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat);
- SURFACE_UnlockSurface(psurfBmp);
+ SURFACE_ShareUnlockSurface(psurfBmp);
}
}
@@ -1197,7 +1197,7 @@
/* In order to correctly display 32 bit icons Windows first scans the image,
because information about transparency is not stored in any image's
headers */
- psurfOff = SURFACE_LockSurface(hbmColor);
+ psurfOff = SURFACE_ShareLockSurface(hbmColor);
if (psurfOff)
{
fnSource_GetPixel =
DibFunctionsForBitmapFormat[psurfOff->SurfObj.iBitmapFormat].DIB_GetPixel;
@@ -1215,7 +1215,7 @@
break;
}
}
- SURFACE_UnlockSurface(psurfOff);
+ SURFACE_ShareUnlockSurface(psurfOff);
}
}
@@ -1272,7 +1272,7 @@
goto CleanupAlpha;
}
- psurf = SURFACE_LockSurface(hMemBmp);
+ psurf = SURFACE_ShareLockSurface(hMemBmp);
if(!psurf)
{
DPRINT1("SURFACE_LockSurface failed!\n");
@@ -1294,7 +1294,7 @@
}
}
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
hTmpBmp = NtGdiSelectBitmap(hMemDC, hMemBmp);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] Mon Apr 18
19:09:05 2011
@@ -634,7 +634,7 @@
}
/* Try to get the size of the wallpaper */
- if(!(psurfBmp = SURFACE_LockSurface(hbmp)))
+ if(!(psurfBmp = SURFACE_ShareLockSurface(hbmp)))
{
GreDeleteObject(hbmp);
return 0;
@@ -644,7 +644,7 @@
gpwinstaCurrent->cyWallpaper = psurfBmp->SurfObj.sizlBitmap.cy;
gpwinstaCurrent->WallpaperMode = wmCenter;
- SURFACE_UnlockSurface(psurfBmp);
+ SURFACE_ShareUnlockSurface(psurfBmp);
/* Change the bitmap's ownership */
GDIOBJ_SetOwnership(hbmp, NULL);
@@ -907,7 +907,7 @@
case SPI_SETWORKAREA:
{
- /*FIXME: we should set the work area of the monitor
+ /*FIXME: we should set the work area of the monitor
that contains the specified rectangle*/
PMONITOR pmonitor = IntGetPrimaryMonitor();
RECT rcWorkArea;
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] Mon Apr 18
19:09:05 2011
@@ -270,7 +270,7 @@
1,
dibs.dsBm.bmBitsPixel,
NULL);
- psurfBmp = SURFACE_LockSurface(Bmp);
+ psurfBmp = SURFACE_ShareLockSurface(Bmp);
ASSERT(psurfBmp);
/* Assign palette */
psurfBmp->ppal = psurf->ppal;
@@ -278,7 +278,7 @@
/* Set flags */
psurfBmp->flags = API_BITMAP;
psurfBmp->hdc = NULL; // Fixme
- SURFACE_UnlockSurface(psurfBmp);
+ SURFACE_ShareUnlockSurface(psurfBmp);
}
else if (Count == sizeof(DIBSECTION))
{
@@ -316,7 +316,7 @@
return 0;
}
- PalGDI = PALETTE_LockPalette(psurf->ppal->BaseObject.hHmgr);
+ PalGDI = PALETTE_ShareLockPalette(psurf->ppal->BaseObject.hHmgr);
for (Index = 0;
Index < 256 && Index < PalGDI->NumColors;
@@ -327,7 +327,7 @@
bi->bmiColors[Index].rgbBlue =
PalGDI->IndexedColors[Index].peBlue;
bi->bmiColors[Index].rgbReserved = 0;
}
- PALETTE_UnlockPalette(PalGDI);
+ PALETTE_ShareUnlockPalette(PalGDI);
}
Bmp = DIB_CreateDIBSection(Dc,
@@ -390,7 +390,7 @@
if (hBitmap == NULL)
return FALSE;
- psurfBmp = SURFACE_LockSurface(hBitmap);
+ psurfBmp = SURFACE_ShareLockSurface(hBitmap);
if (psurfBmp == NULL)
{
EngSetLastError(ERROR_INVALID_HANDLE);
@@ -408,7 +408,7 @@
}
_SEH2_END
- SURFACE_UnlockSurface(psurfBmp);
+ SURFACE_ShareUnlockSurface(psurfBmp);
return Ret;
}
@@ -496,12 +496,12 @@
NtGdiSelectBitmap(hDCTmp, hBmpOld);
// our bitmap is no longer selected, so we can access it's
stuff...
- psurf = SURFACE_LockSurface(hBmpTmp);
+ psurf = SURFACE_ShareLockSurface(hBmpTmp);
if (psurf)
{
// Dont you need to convert something here?
Result = *(COLORREF*)psurf->SurfObj.pvScan0;
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
}
}
GreDeleteObject(hBmpTmp);
@@ -598,7 +598,7 @@
return 0;
}
- psurf = SURFACE_LockSurface(hBitmap);
+ psurf = SURFACE_ShareLockSurface(hBitmap);
if (!psurf)
{
EngSetLastError(ERROR_INVALID_HANDLE);
@@ -612,7 +612,7 @@
/* If the bits vector is null, the function should return the read size */
if (pUnsafeBits == NULL)
{
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
return bmSize;
}
@@ -632,7 +632,7 @@
}
_SEH2_END
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
return ret;
}
@@ -652,7 +652,7 @@
return 0;
}
- psurf = SURFACE_LockSurface(hBitmap);
+ psurf = SURFACE_ShareLockSurface(hBitmap);
if (psurf == NULL)
{
EngSetLastError(ERROR_INVALID_HANDLE);
@@ -671,7 +671,7 @@
}
_SEH2_END
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
return ret;
}
@@ -689,7 +689,7 @@
if (hBitmap == NULL)
return FALSE;
- psurf = SURFACE_LockSurface(hBitmap);
+ psurf = SURFACE_ShareLockSurface(hBitmap);
if (psurf == NULL)
{
EngSetLastError(ERROR_INVALID_HANDLE);
@@ -714,7 +714,7 @@
psurf->sizlDim.cx = Width;
psurf->sizlDim.cy = Height;
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
return Ret;
}
@@ -998,11 +998,11 @@
IN HBITMAP hsurf)
{
HDC hdc = NULL;
- PSURFACE psurf = SURFACE_LockSurface(hsurf);
+ PSURFACE psurf = SURFACE_ShareLockSurface(hsurf);
if (psurf)
{
hdc = psurf->hdc;
- SURFACE_UnlockSurface(psurf);
+ SURFACE_ShareUnlockSurface(psurf);
}
return hdc;
}
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] Mon Apr 18
19:09:05 2011
@@ -164,7 +164,7 @@
return 0;
}
- PalGDI = PALETTE_LockPalette(psurf->ppal->BaseObject.hHmgr);
+ PalGDI = PALETTE_ShareLockPalette(psurf->ppal->BaseObject.hHmgr);
for (Index = StartIndex;
Index < StartIndex + Entries && Index <
PalGDI->NumColors;
@@ -174,7 +174,7 @@
PalGDI->IndexedColors[Index].peGreen = Colors[Index -
StartIndex].rgbGreen;
PalGDI->IndexedColors[Index].peBlue = Colors[Index - StartIndex].rgbBlue;
}
- PALETTE_UnlockPalette(PalGDI);
+ PALETTE_ShareUnlockPalette(PalGDI);
}
else
Entries = 0;
@@ -277,8 +277,8 @@
bmi->bmiHeader.biHeight,
bmi->bmiHeader.biBitCount));
- psurfDst = SURFACE_LockSurface(hBitmap);
- psurfSrc = SURFACE_LockSurface(SourceBitmap);
+ psurfDst = SURFACE_ShareLockSurface(hBitmap);
+ psurfSrc = SURFACE_ShareLockSurface(SourceBitmap);
if(!(psurfSrc && psurfDst))
{
@@ -311,11 +311,11 @@
cleanup:
if(psurfSrc)
{
- SURFACE_UnlockSurface(psurfSrc);
+ SURFACE_ShareUnlockSurface(psurfSrc);
}
if(psurfDst)
{
- SURFACE_UnlockSurface(psurfDst);
+ SURFACE_ShareUnlockSurface(psurfDst);
}
GreDeleteObject(SourceBitmap);
@@ -766,7 +766,7 @@
/* For color DDBs in native depth (mono DDBs always have
a black/white palette):
Generate the color map from the selected palette */
- PPALETTE pDcPal = PALETTE_LockPalette(pDC->dclevel.hpal);
+ PPALETTE pDcPal = PALETTE_ShareLockPalette(pDC->dclevel.hpal);
if(!pDcPal)
{
ScanLines = 0 ;
@@ -786,7 +786,7 @@
rgbQuads[i].rgbBlue = pDcPal->IndexedColors[i].peBlue;
rgbQuads[i].rgbReserved = 0;
}
- PALETTE_UnlockPalette(pDcPal);
+ PALETTE_ShareUnlockPalette(pDcPal);
}
else
{
@@ -1548,10 +1548,10 @@
{
if(dc)
{
- PPALETTE pdcPal ;
- pdcPal = PALETTE_LockPalette(dc->dclevel.hpal);
- hpal = DIB_MapPaletteColors(pdcPal, bmi);
- PALETTE_UnlockPalette(pdcPal);
+ PPALETTE ppalDc;
+ ppalDc = PALETTE_ShareLockPalette(dc->dclevel.hpal);
+ hpal = DIB_MapPaletteColors(ppalDc, bmi);
+ PALETTE_ShareUnlockPalette(ppalDc);
}
else
{
Modified: trunk/reactos/subsystems/win32/win32k/objects/icm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/icm.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/icm.c [iso-8859-1] Mon Apr 18 19:09:05
2011
@@ -251,7 +251,7 @@
if (!(pGDev->flFlags & PDEV_GAMMARAMP_TABLE)) return FALSE;
- palGDI = PALETTE_LockPalette(pGDev->devinfo.hpalDefault);
+ palGDI = PALETTE_ShareLockPalette(pGDev->devinfo.hpalDefault);
if(!palGDI) return FALSE;
palPtr = (PALOBJ*) palGDI;
@@ -272,7 +272,7 @@
0,
palGDI->NumColors);
}
- PALETTE_UnlockPalette(palGDI);
+ PALETTE_ShareUnlockPalette(palGDI);
return Ret;
}
else