Author: tkreuzer
Date: Wed Apr 15 00:50:02 2009
New Revision: 40509
URL:
http://svn.reactos.org/svn/reactos?rev=40509&view=rev
Log:
Remove hBitmap from DC.rosdc and use DC.dclevel.pSurface instead.
Modified:
trunk/reactos/subsystems/win32/win32k/include/dc.h
trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
trunk/reactos/subsystems/win32/win32k/ntuser/input.c
trunk/reactos/subsystems/win32/win32k/objects/arc.c
trunk/reactos/subsystems/win32/win32k/objects/bitblt.c
trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
trunk/reactos/subsystems/win32/win32k/objects/dclife.c
trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c
trunk/reactos/subsystems/win32/win32k/objects/dcstate.c
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
trunk/reactos/subsystems/win32/win32k/objects/drawing.c
trunk/reactos/subsystems/win32/win32k/objects/fillshap.c
trunk/reactos/subsystems/win32/win32k/objects/freetype.c
trunk/reactos/subsystems/win32/win32k/objects/line.c
trunk/reactos/subsystems/win32/win32k/objects/print.c
trunk/reactos/subsystems/win32/win32k/objects/region.c
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Wed Apr 15 00:50:02
2009
@@ -17,7 +17,6 @@
HRGN hClipRgn; /* Clip region (may be 0) */
HRGN hVisRgn; /* Should me to DC. Visible region (must never be 0) */
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
- HBITMAP hBitmap;
BYTE bitsPerPixel;
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] Wed Apr 15
00:50:02 2009
@@ -89,7 +89,6 @@
PSYSTEM_CURSORINFO CurInfo;
PCURICON_OBJECT OldCursor;
HCURSOR Ret = (HCURSOR)0;
- HBITMAP dcbmp;
HBITMAP hMask = 0;
SURFOBJ *soMask = NULL, *soColor = NULL;
XLATEOBJ *XlateObj = NULL;
@@ -120,13 +119,14 @@
{
return Ret;
}
- dcbmp = dc->rosdc.hBitmap;
DevInfo = (PDEVINFO)&dc->ppdev->DevInfo;
- DC_UnlockDc(dc);
-
- psurf = SURFACE_LockSurface(dcbmp);
+
+ psurf = dc->dclevel.pSurface;
if (!psurf)
+ {
+ DC_UnlockDc(dc);
return (HCURSOR)0;
+ }
pso = &psurf->SurfObj;
if (!NewCursor)
@@ -148,7 +148,7 @@
CurInfo->ShowingCursor = 0;
}
- SURFACE_UnlockSurface(psurf);
+ DC_UnlockDc(dc);
return Ret;
}
@@ -162,7 +162,7 @@
if (maskBpp != 1)
{
DPRINT1("SetCursor: The Mask bitmap must have 1BPP!\n");
- SURFACE_UnlockSurface(psurf);
+ DC_UnlockDc(dc);
return Ret;
}
@@ -207,7 +207,7 @@
if ( !hMask )
{
SURFACE_UnlockSurface(MaskBmpObj);
- SURFACE_UnlockSurface(psurf);
+ DC_UnlockDc(dc);
return (HCURSOR)0;
}
soMask = EngLockSurface((HSURF)hMask);
@@ -249,7 +249,6 @@
DPRINT1("IntEngSetPointerShape returned %lx\n", Status);
}
- SURFACE_UnlockSurface(psurf);
if(hMask)
{
EngUnlockSurface(soMask);
@@ -260,6 +259,7 @@
EngDeleteXlate(XlateObj);
}
+ DC_UnlockDc(dc);
return Ret;
}
@@ -1724,7 +1724,6 @@
HDC Screen;
PDC dc;
- HBITMAP hbmpDc;
SURFOBJ *SurfObj;
SURFACE *psurfDc;
PDEVOBJ *ppdev;
@@ -1743,19 +1742,18 @@
return showpointer; /* No mouse */
}
- hbmpDc = dc->rosdc.hBitmap;
- DC_UnlockDc(dc);
-
- psurfDc = SURFACE_LockSurface(hbmpDc);
+ psurfDc = dc->dclevel.pSurface;
+
if ( !psurfDc )
{
+ DC_UnlockDc(dc);
return showpointer; /* No Mouse */
}
SurfObj = &psurfDc->SurfObj;
if (SurfObj == NULL)
{
- SURFACE_UnlockSurface(psurfDc);
+ DC_UnlockDc(dc);
return showpointer; /* No mouse */
}
@@ -1763,7 +1761,7 @@
if(ppdev == NULL)
{
- SURFACE_UnlockSurface(psurfDc);
+ DC_UnlockDc(dc);
return showpointer; /* No mouse */
}
@@ -1800,6 +1798,6 @@
}
}
- SURFACE_UnlockSurface(psurfDc);
+ DC_UnlockDc(dc);
return showpointer;
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -432,12 +432,11 @@
SURFACE *psurf;
dc = DC_LockDc(ScreenDeviceContext);
/* FIXME - Handle dc == NULL!!!! */
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
- if(psurf)
+ psurf = dc->dclevel.pSurface;
+ if (psurf)
{
Ret->right = psurf->SurfObj.sizlBitmap.cx;
Ret->bottom = psurf->SurfObj.sizlBitmap.cy;
- SURFACE_UnlockSurface(psurf);
}
DC_UnlockDc(dc);
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/input.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/input.c [iso-8859-1] Wed Apr 15 00:50:02
2009
@@ -1072,7 +1072,6 @@
PWINSTATION_OBJECT WinSta;
BOOL DoMove, SwapButtons;
MSG Msg;
- HBITMAP hBitmap;
SURFACE *psurf;
SURFOBJ *pso;
PDC dc;
@@ -1169,10 +1168,7 @@
dc = DC_LockDc(hDC);
if (dc)
{
- hBitmap = dc->rosdc.hBitmap;
- DC_UnlockDc(dc);
-
- psurf = SURFACE_LockSurface(hBitmap);
+ psurf = dc->dclevel.pSurface;
if (psurf)
{
pso = &psurf->SurfObj;
@@ -1185,9 +1181,9 @@
* use the old values to move the pointer image */
gpsi->ptCursor.x = MousePos.x;
gpsi->ptCursor.y = MousePos.y;
-
- SURFACE_UnlockSurface(psurf);
- }
+ }
+
+ DC_UnlockDc(dc);
}
}
Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] Wed Apr 15 00:50:02
2009
@@ -156,7 +156,7 @@
arctype,
pbrushPen);
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
if (NULL == psurf)
{
DPRINT1("Arc Fail 2\n");
@@ -174,7 +174,6 @@
PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY,
dc->eboLine);
pbrushPen->ptPenWidth.x = PenOrigWidth;
- SURFACE_UnlockSurface(psurf);
PEN_UnlockPen(pbrushPen);
DPRINT("IntArc Exit.\n");
return ret;
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitblt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -120,7 +120,7 @@
}
/* Determine surfaces to be used in the bitblt */
- BitmapDest = SURFACE_LockSurface(DCDest->rosdc.hBitmap);
+ BitmapDest = DCDest->dclevel.pSurface;
if (!BitmapDest)
{
if (hDCSrc != hDCDest)
@@ -128,14 +128,11 @@
DC_UnlockDc(DCDest);
return FALSE;
}
- if (DCSrc->rosdc.hBitmap == DCDest->rosdc.hBitmap)
- BitmapSrc = BitmapDest;
- else
- {
- BitmapSrc = SURFACE_LockSurface(DCSrc->rosdc.hBitmap);
+
+ {
+ BitmapSrc = DCSrc->dclevel.pSurface;
if (!BitmapSrc)
{
- SURFACE_UnlockSurface(BitmapDest);
if (hDCSrc != hDCDest)
DC_UnlockDc(DCSrc);
DC_UnlockDc(DCDest);
@@ -164,9 +161,6 @@
if (XlateObj != NULL)
EngDeleteXlate(XlateObj);
- SURFACE_UnlockSurface(BitmapDest);
- if (BitmapSrc != BitmapDest)
- SURFACE_UnlockSurface(BitmapSrc);
DC_UnlockDc(DCDest);
if (hDCSrc != hDCDest)
DC_UnlockDc(DCSrc);
@@ -264,17 +258,14 @@
}
/* Determine surfaces to be used in the bitblt */
- BitmapDest = SURFACE_LockSurface(DCDest->rosdc.hBitmap);
+ BitmapDest = DCDest->dclevel.pSurface;
if (!BitmapDest)
goto cleanup;
if (UsesSource)
{
- if (DCSrc->rosdc.hBitmap == DCDest->rosdc.hBitmap)
- BitmapSrc = BitmapDest;
- else
- {
- BitmapSrc = SURFACE_LockSurface(DCSrc->rosdc.hBitmap);
+ {
+ BitmapSrc = DCSrc->dclevel.pSurface;
if (!BitmapSrc)
goto cleanup;
}
@@ -311,14 +302,6 @@
if (UsesSource && XlateObj != NULL)
EngDeleteXlate(XlateObj);
- if(BitmapDest != NULL)
- {
- SURFACE_UnlockSurface(BitmapDest);
- }
- if (BitmapSrc != NULL && BitmapSrc != BitmapDest)
- {
- SURFACE_UnlockSurface(BitmapSrc);
- }
if (UsesSource && hDCSrc != hDCDest)
{
DC_UnlockDc(DCSrc);
@@ -387,13 +370,13 @@
return TRUE;
}
- BitmapDest = SURFACE_LockSurface(DCDest->rosdc.hBitmap);
+ BitmapDest = DCDest->dclevel.pSurface;
if (!BitmapDest)
{
goto done;
}
- BitmapSrc = SURFACE_LockSurface(DCSrc->rosdc.hBitmap);
+ BitmapSrc = DCSrc->dclevel.pSurface;
if (!BitmapSrc)
{
goto done;
@@ -466,14 +449,6 @@
done:
DC_UnlockDc(DCSrc);
- if (BitmapDest)
- {
- SURFACE_UnlockSurface(BitmapDest);
- }
- if (BitmapSrc)
- {
- SURFACE_UnlockSurface(BitmapSrc);
- }
if(hdcDst != hdcSrc)
{
DC_UnlockDc(DCDest);
@@ -826,18 +801,13 @@
BrushOrigin.y = 0;
/* Determine surfaces to be used in the bitblt */
- BitmapDest = SURFACE_LockSurface(DCDest->rosdc.hBitmap);
+ BitmapDest = DCDest->dclevel.pSurface;
if (BitmapDest == NULL)
goto failed;
if (UsesSource)
{
- if (DCSrc->rosdc.hBitmap == DCDest->rosdc.hBitmap)
- {
- BitmapSrc = BitmapDest;
- }
- else
- {
- BitmapSrc = SURFACE_LockSurface(DCSrc->rosdc.hBitmap);
+ {
+ BitmapSrc = DCSrc->dclevel.pSurface;
if (BitmapSrc == NULL)
goto failed;
}
@@ -862,7 +832,7 @@
DCMask = DC_LockDc(hDCMask);
if (DCMask)
{
- BitmapMask = SURFACE_LockSurface(DCMask->rosdc.hBitmap);
+ BitmapMask = DCMask->dclevel.pSurface;
if (BitmapMask &&
(BitmapMask->SurfObj.sizlBitmap.cx != WidthSrc ||
BitmapMask->SurfObj.sizlBitmap.cy != HeightSrc))
@@ -890,18 +860,6 @@
if (XlateObj)
{
EngDeleteXlate(XlateObj);
- }
- if (BitmapSrc && DCSrc->rosdc.hBitmap != DCDest->rosdc.hBitmap)
- {
- SURFACE_UnlockSurface(BitmapSrc);
- }
- if (BitmapDest)
- {
- SURFACE_UnlockSurface(BitmapDest);
- }
- if (BitmapMask)
- {
- SURFACE_UnlockSurface(BitmapMask);
}
if (UsesSource && hDCSrc != hDCDest)
{
@@ -967,7 +925,7 @@
ASSERT(BrushObj);
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
if (psurf == NULL)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
@@ -1023,8 +981,6 @@
&BrushOrigin,
ROP3_TO_ROP4(ROP));
}
-
- SURFACE_UnlockSurface(psurf);
return ret;
}
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] Wed Apr 15
00:50:02 2009
@@ -154,7 +154,7 @@
{
DIBSECTION dibs;
INT Count;
- PSURFACE psurf = SURFACE_LockSurface(Dc->rosdc.hBitmap);
+ PSURFACE psurf = Dc->dclevel.pSurface;
Count = BITMAP_GetObject(psurf, sizeof(dibs), &dibs);
if (Count)
@@ -223,7 +223,6 @@
if (!PalGDI)
{
ExFreePoolWithTag(bi, TAG_TEMP);
- SURFACE_UnlockSurface(psurf);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return 0;
}
@@ -239,7 +238,6 @@
}
PALETTE_UnlockPalette(PalGDI);
}
- SURFACE_UnlockSurface(psurf);
Bmp = DIB_CreateDIBSection(Dc,
bi,
@@ -254,7 +252,6 @@
}
}
}
- SURFACE_UnlockSurface(psurf);
}
}
return Bmp;
@@ -361,7 +358,7 @@
if (RECTL_bPointInRect(&dc->rosdc.CombinedClip->rclBounds, XPos, YPos))
{
bInRect = TRUE;
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
pso = &psurf->SurfObj;
if (psurf)
{
@@ -381,7 +378,6 @@
}
EngDeleteXlate(XlateObj);
}
- SURFACE_UnlockSurface(psurf);
}
}
DC_UnlockDc(dc);
Modified: trunk/reactos/subsystems/win32/win32k/objects/dclife.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -212,6 +212,7 @@
HRGN hVisRgn;
UNICODE_STRING StdDriver;
BOOL calledFromUser;
+ HSURF hsurf;
RtlInitUnicodeString(&StdDriver, L"DISPLAY");
@@ -284,7 +285,9 @@
pdc->dhpdev = PrimarySurface.hPDev;
if (pUMdhpdev) pUMdhpdev = pdc->dhpdev; // set DHPDEV for device.
pdc->ppdev = (PVOID)&PrimarySurface;
- pdc->rosdc.hBitmap = (HBITMAP)PrimarySurface.pSurface; // <- what kind of
haxx0ry is that?
+ hsurf = (HBITMAP)PrimarySurface.pSurface; // <- what kind of haxx0ry is that?
+ pdc->dclevel.pSurface = SURFACE_ShareLockSurface(hsurf);
+
// ATM we only have one display.
pdcattr->ulDirty_ |= DC_PRIMARY_DISPLAY;
@@ -574,6 +577,7 @@
HRGN hVisRgn;
UNICODE_STRING DriverName;
DWORD Layout = 0;
+ HSURF hsurf;
if (hDC == NULL)
{
@@ -628,7 +632,8 @@
pdcattrNew->szlViewportExt = pdcattrOld->szlViewportExt;
pdcNew->dctype = DC_TYPE_MEMORY; // Always!
- pdcNew->rosdc.hBitmap = NtGdiGetStockObject(DEFAULT_BITMAP);
+ hsurf = NtGdiGetStockObject(DEFAULT_BITMAP);
+ pdcNew->dclevel.pSurface = SURFACE_ShareLockSurface(hsurf);
pdcNew->ppdev = pdcOld->ppdev;
pdcNew->dclevel.hpal = pdcOld->dclevel.hpal;
Modified: trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -20,11 +20,10 @@
XLATEOBJ *pxlo = NULL;
HPALETTE hPalette = NULL;
- psurf = SURFACE_LockSurface(pdc->rosdc.hBitmap);
+ psurf = pdc->dclevel.pSurface;
if (psurf)
{
hPalette = psurf->hDIBPalette;
- SURFACE_UnlockSurface(psurf);
}
if (!hPalette) hPalette = pPrimarySurface->DevInfo.hpalDefault;
@@ -185,14 +184,12 @@
SURFACE *psurf;
HPALETTE hpal;
-// psurf = pdc->dclevel.pSurface;
- psurf = SURFACE_LockSurface(pdc->rosdc.hBitmap);
+ psurf = pdc->dclevel.pSurface;
if (psurf)
{
hpal = psurf->hDIBPalette;
if (!hpal) hpal = pPrimarySurface->DevInfo.hpalDefault;
pxlo = IntEngCreateXlate(0, PAL_RGB, hpal, NULL);
- SURFACE_UnlockSurface(psurf);
}
/* Update the eboText's solid color */
@@ -216,14 +213,12 @@
SURFACE *psurf;
HPALETTE hpal;
-// psurf = pdc->dclevel.pSurface;
- psurf = SURFACE_LockSurface(pdc->rosdc.hBitmap);
+ psurf = pdc->dclevel.pSurface;
if (psurf)
{
hpal = psurf->hDIBPalette;
if (!hpal) hpal = pPrimarySurface->DevInfo.hpalDefault;
pxlo = IntEngCreateXlate(0, PAL_RGB, hpal, NULL);
- SURFACE_UnlockSurface(psurf);
}
/* Update the eboBackground's solid color */
@@ -386,11 +381,6 @@
psurfOld = pDC->dclevel.pSurface;
hOrgBmp = psurfOld ? psurfOld->BaseObject.hHmgr : NULL;
- /* FIXME: ros hack */
- hOrgBmp = pDC->rosdc.hBitmap;
-
- pDC->rosdc.hBitmap = hBmp;
-
/* Release the old bitmap, reference the new */
DC_vSelectSurface(pDC, psurfBmp);
@@ -530,8 +520,11 @@
break;
case GDI_OBJECT_TYPE_BITMAP:
- SelObject = pdc->rosdc.hBitmap;
- break;
+ {
+ SURFACE *psurf = pdc->dclevel.pSurface;
+ SelObject = psurf ? psurf->BaseObject.hHmgr : NULL;
+ break;
+ }
case GDI_OBJECT_TYPE_COLORSPACE:
DPRINT1("FIXME: NtGdiGetCurrentObject() ObjectType OBJ_COLORSPACE not
supported yet!\n");
Modified: trunk/reactos/subsystems/win32/win32k/objects/dcstate.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -48,8 +48,6 @@
pdcDst->dclevel.plfnt = pdcSrc->dclevel.plfnt;
/* ROS hacks */
- pdcDst->rosdc.hBitmap = pdcSrc->rosdc.hBitmap;
-
if (pdcDst->dctype != DC_TYPE_MEMORY)
{
pdcDst->rosdc.bitsPerPixel = pdcSrc->rosdc.bitsPerPixel;
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] Wed Apr 15
00:50:02 2009
@@ -85,7 +85,7 @@
return 0;
}
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
if (psurf == NULL)
{
DC_UnlockDc(dc);
@@ -95,7 +95,6 @@
if (psurf->hSecure == NULL)
{
- SURFACE_UnlockSurface(psurf);
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return 0;
@@ -110,7 +109,6 @@
PalGDI = PALETTE_LockPalette(psurf->hDIBPalette);
if (PalGDI == NULL)
{
- SURFACE_UnlockSurface(psurf);
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return 0;
@@ -132,7 +130,6 @@
/* Mark the brushes invalid */
dc->pdcattr->ulDirty_ |= DIRTY_FILL|DIRTY_LINE|DIRTY_BACKGROUND|DIRTY_TEXT;
- SURFACE_UnlockSurface(psurf);
DC_UnlockDc(dc);
return Entries;
@@ -154,7 +151,7 @@
return 0;
}
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
if (psurf == NULL)
{
DC_UnlockDc(dc);
@@ -164,7 +161,6 @@
if (psurf->hSecure == NULL)
{
- SURFACE_UnlockSurface(psurf);
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return 0;
@@ -180,7 +176,6 @@
PalGDI = PALETTE_LockPalette(psurf->hDIBPalette);
if (PalGDI == NULL)
{
- SURFACE_UnlockSurface(psurf);
DC_UnlockDc(dc);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return 0;
@@ -200,7 +195,6 @@
else
Entries = 0;
- SURFACE_UnlockSurface(psurf);
DC_UnlockDc(dc);
return Entries;
@@ -484,14 +478,13 @@
DDBPalette = pDC->ppdev->DevInfo.hpalDefault;
/* Try to use hDIBPalette if it exists */
- pSurf = SURFACE_LockSurface(pDC->rosdc.hBitmap);
+ pSurf = pDC->dclevel.pSurface;
if (pSurf && pSurf->hDIBPalette)
{
DDBPalette = pSurf->hDIBPalette;
- SURFACE_UnlockSurface(pSurf);
- }
-
- pDestSurf = EngLockSurface((HSURF)pDC->rosdc.hBitmap);
+ }
+
+ pDestSurf = pSurf ? &pSurf->SurfObj : NULL;
rcDest.left = XDest;
rcDest.top = YDest;
@@ -582,7 +575,6 @@
if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
if (XlateObj) EngDeleteXlate(XlateObj);
if (DIBPalette) PALETTE_FreePaletteByHandle(DIBPalette);
- EngUnlockSurface(pDestSurf);
DC_UnlockDc(pDC);
return ret;
@@ -1257,7 +1249,7 @@
{
DIBSECTION dibs;
INT Count;
- SURFACE *psurf = SURFACE_LockSurface(Dc->rosdc.hBitmap);
+ SURFACE *psurf = Dc->dclevel.pSurface;
Count = BITMAP_GetObject(psurf, sizeof(dibs), &dibs);
if (!Count)
bpp = 1;
@@ -1270,7 +1262,6 @@
/* A DIB section is selected in the DC */
bpp = dibs.dsBmih.biBitCount;
}
- SURFACE_UnlockSurface(psurf);
}
}
Bmp = IntCreateDIBitmap(Dc, cx, cy, bpp, fInit, pjInit, pbmi, iUsage);
Modified: trunk/reactos/subsystems/win32/win32k/objects/drawing.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/drawing.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/drawing.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -1198,7 +1198,7 @@
ASSERT(pbrush);
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
if (psurf == NULL)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
@@ -1249,7 +1249,6 @@
ROP3_TO_ROP4(ROP));
}
- SURFACE_UnlockSurface(psurf);
return (int)Ret;
}
Modified: trunk/reactos/subsystems/win32/win32k/objects/fillshap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -96,7 +96,7 @@
/* Special locking order to avoid lock-ups */
pbrFill = dc->dclevel.pbrFill;
pbrLine = dc->dclevel.pbrLine;
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
/* FIXME - psurf can be NULL!!!! don't assert but handle this case
gracefully! */
ASSERT(psurf);
@@ -153,7 +153,6 @@
}
}
}
- SURFACE_UnlockSurface(psurf);
return ret;
}
@@ -581,7 +580,7 @@
ret = FALSE;
goto cleanup;
}
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
if (!psurf)
{
ret = FALSE;
@@ -646,9 +645,6 @@
}
cleanup:
- if (psurf)
- SURFACE_UnlockSurface(psurf);
-
/* Move current position in DC?
MSDN: The current position is neither used nor updated by Rectangle. */
@@ -917,7 +913,7 @@
DitherOrg.x += dc->ptlDCOrig.x;
DitherOrg.y += dc->ptlDCOrig.y;
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
/* FIXME - psurf can be NULL!!! Don't assert but handle this case gracefully! */
ASSERT(psurf);
@@ -947,7 +943,6 @@
&DitherOrg,
ulMode);
- SURFACE_UnlockSurface(psurf);
EngDeleteXlate(XlateObj);
return Ret;
@@ -1121,7 +1116,7 @@
Ret = FALSE;
goto cleanup;
}
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
if (!psurf)
{
Ret = FALSE;
@@ -1129,9 +1124,6 @@
}
cleanup:
- if (psurf)
- SURFACE_UnlockSurface(psurf);
-
DC_UnlockDc(dc);
return Ret;
}
Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -3171,7 +3171,7 @@
IntLPtoDP(dc, (POINT *)lprc, 2);
}
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
if (!psurf)
{
goto fail;
@@ -3579,7 +3579,6 @@
EngDeleteXlate(XlateObj);
EngDeleteXlate(XlateObj2);
- SURFACE_UnlockSurface(psurf);
if (TextObj != NULL)
TEXTOBJ_UnlockText(TextObj);
good:
@@ -3594,8 +3593,6 @@
EngDeleteXlate(XlateObj);
if (TextObj != NULL)
TEXTOBJ_UnlockText(TextObj);
- if (psurf != NULL)
- SURFACE_UnlockSurface(psurf);
DC_UnlockDc(dc);
return FALSE;
Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] Wed Apr 15 00:50:02
2009
@@ -113,7 +113,7 @@
if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
DC_vUpdateLineBrush(dc);
- psurf = SURFACE_LockSurface( dc->rosdc.hBitmap );
+ psurf = dc->dclevel.pSurface;
if (NULL == psurf)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
@@ -153,7 +153,6 @@
ROP2_TO_MIX(pdcattr->jROP2));
}
- SURFACE_UnlockSurface(psurf);
}
if (Ret)
@@ -263,7 +262,7 @@
Points = EngAllocMem(0, Count * sizeof(POINT), TAG_COORD);
if (Points != NULL)
{
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
/* FIXME - psurf can be NULL!!!!
Don't assert but handle this case gracefully! */
ASSERT(psurf);
@@ -285,7 +284,6 @@
Count,
ROP2_TO_MIX(pdcattr->jROP2));
- SURFACE_UnlockSurface(psurf);
EngFreeMem(Points);
}
else
Modified: trunk/reactos/subsystems/win32/win32k/objects/print.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/print.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/print.c [iso-8859-1] Wed Apr 15 00:50:02
2009
@@ -114,7 +114,7 @@
INT OutSize,
LPSTR OutData)
{
- SURFACE *psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ SURFACE *psurf = dc->dclevel.pSurface;
INT Result;
/* FIXME - Handle psurf == NULL !!!!!! */
@@ -139,7 +139,6 @@
OutSize,
(PVOID)OutData );
}
- SURFACE_UnlockSurface(psurf);
return Result;
}
Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Wed Apr 15
00:50:02 2009
@@ -2936,7 +2936,7 @@
BrushOrigin.x = pdcattr->ptlBrushOrigin.x;
BrushOrigin.y = pdcattr->ptlBrushOrigin.y;
- psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
+ psurf = dc->dclevel.pSurface;
/* FIXME - Handle psurf == NULL !!!! */
bRet = IntEngPaint(&psurf->SurfObj,
@@ -2945,7 +2945,6 @@
&BrushOrigin,
0xFFFF);//FIXME:don't know what to put here
- SURFACE_UnlockSurface(psurf);
REGION_UnlockRgn(visrgn);
GreDeleteObject(tmpVisRgn);