Author: arty
Date: Thu Mar 26 05:33:15 2009
New Revision: 40245
URL:
http://svn.reactos.org/svn/reactos?rev=40245&view=rev
Log:
Prevent a double lock on the surface by splitting FillSolid into a locking and
unlocked version, allowing surface.c to use the locking version.
Modified:
trunk/reactos/subsystems/win32/win32k/eng/paint.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/paint.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/paint.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/paint.c [iso-8859-1] Thu Mar 26 05:33:15
2009
@@ -32,7 +32,7 @@
#define NDEBUG
#include <debug.h>
-BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
+static BOOL APIENTRY FillSolidUnlocked(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
{
LONG y;
ULONG LineWidth;
@@ -41,7 +41,6 @@
ASSERT(pso);
ASSERT(pRect);
psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
- SURFACE_LockBitmapBits(psurf);
MouseSafetyOnDrawStart(pso, pRect->left, pRect->top, pRect->right,
pRect->bottom);
LineWidth = pRect->right - pRect->left;
DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth, pRect->top,
pRect->bottom);
@@ -51,9 +50,19 @@
pso, pRect->left, pRect->right, y, iColor);
}
MouseSafetyOnDrawEnd(pso);
- SURFACE_UnlockBitmapBits(psurf);
return TRUE;
+}
+
+BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
+{
+ SURFACE *psurf;
+ BOOL Result;
+ psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
+ SURFACE_LockBitmapBits(psurf);
+ Result = FillSolidUnlocked(pso, pRect, iColor);
+ SURFACE_UnlockBitmapBits(psurf);
+ return Result;
}
BOOL APIENTRY
@@ -78,7 +87,7 @@
if (ClipRegion->iDComplexity == DC_RECT)
{
- FillSolid(pso, &(ClipRegion->rclBounds), iColor);
+ FillSolidUnlocked(pso, &(ClipRegion->rclBounds), iColor);
} else {
/* Enumerate all the rectangles and draw them */
@@ -87,7 +96,7 @@
do {
EnumMore = CLIPOBJ_bEnum(ClipRegion, sizeof(RectEnum), (PVOID) &RectEnum);
for (i = 0; i < RectEnum.c; i++) {
- FillSolid(pso, RectEnum.arcl + i, iColor);
+ FillSolidUnlocked(pso, RectEnum.arcl + i, iColor);
}
} while (EnumMore);
}