mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 16:30:26 +00:00
[WIN32K]
- Finally get rid of SURFACE::BitsLock svn path=/branches/reactos-yarotows/; revision=46935
This commit is contained in:
parent
75dff0cf6a
commit
083f2b4f4a
12 changed files with 18 additions and 184 deletions
|
@ -305,11 +305,6 @@ IntEngAlphaBlend(IN SURFOBJ *psoDest,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SURFACE_LockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
if (psoSource != psoDest)
|
|
||||||
SURFACE_LockBitmapBits(psurfSource);
|
|
||||||
|
|
||||||
/* Call the driver's DrvAlphaBlend if available */
|
/* Call the driver's DrvAlphaBlend if available */
|
||||||
if (psurfDest->flHooks & HOOK_ALPHABLEND)
|
if (psurfDest->flHooks & HOOK_ALPHABLEND)
|
||||||
{
|
{
|
||||||
|
@ -324,10 +319,6 @@ IntEngAlphaBlend(IN SURFOBJ *psoDest,
|
||||||
DestRect, SourceRect, BlendObj);
|
DestRect, SourceRect, BlendObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (psoSource != psoDest)
|
|
||||||
SURFACE_UnlockBitmapBits(psurfSource);
|
|
||||||
SURFACE_UnlockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -582,19 +582,6 @@ IntEngBitBltEx(
|
||||||
psurfSrc = NULL;
|
psurfSrc = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bRemoveMouse)
|
|
||||||
{
|
|
||||||
SURFACE_LockBitmapBits(psurfTrg);
|
|
||||||
|
|
||||||
if (psoSrc)
|
|
||||||
{
|
|
||||||
if (psoSrc != psoTrg)
|
|
||||||
{
|
|
||||||
SURFACE_LockBitmapBits(psurfSrc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Is the target surface device managed? */
|
/* Is the target surface device managed? */
|
||||||
if (psurfTrg->flHooks & HOOK_BITBLT)
|
if (psurfTrg->flHooks & HOOK_BITBLT)
|
||||||
{
|
{
|
||||||
|
@ -632,18 +619,6 @@ IntEngBitBltEx(
|
||||||
|
|
||||||
// FIXME: cleanup temp surface!
|
// FIXME: cleanup temp surface!
|
||||||
|
|
||||||
if (bRemoveMouse)
|
|
||||||
{
|
|
||||||
if (psoSrc)
|
|
||||||
{
|
|
||||||
if (psoSrc != psoTrg)
|
|
||||||
{
|
|
||||||
SURFACE_UnlockBitmapBits(psurfSrc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SURFACE_UnlockBitmapBits(psurfTrg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return bResult;
|
return bResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -972,8 +947,6 @@ IntEngMaskBlt(SURFOBJ *psoDest,
|
||||||
ASSERT(psoDest);
|
ASSERT(psoDest);
|
||||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||||
|
|
||||||
SURFACE_LockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
/* Dummy BitBlt to let driver know that it should flush its changes.
|
/* Dummy BitBlt to let driver know that it should flush its changes.
|
||||||
This should really be done using a call to DrvSynchronizeSurface,
|
This should really be done using a call to DrvSynchronizeSurface,
|
||||||
but the VMware driver doesn't hook that call. */
|
but the VMware driver doesn't hook that call. */
|
||||||
|
@ -989,8 +962,6 @@ IntEngMaskBlt(SURFOBJ *psoDest,
|
||||||
DestRect, pptlMask, pptlMask, pbo, BrushOrigin,
|
DestRect, pptlMask, pptlMask, pbo, BrushOrigin,
|
||||||
R4_NOOP, FALSE);
|
R4_NOOP, FALSE);
|
||||||
|
|
||||||
SURFACE_UnlockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,13 +53,7 @@ EngCopyBits(SURFOBJ *psoDest,
|
||||||
ASSERT(psoDest != NULL && psoSource != NULL && DestRect != NULL && SourcePoint != NULL);
|
ASSERT(psoDest != NULL && psoSource != NULL && DestRect != NULL && SourcePoint != NULL);
|
||||||
|
|
||||||
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
||||||
SURFACE_LockBitmapBits(psurfSource);
|
|
||||||
|
|
||||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||||
if (psoDest != psoSource)
|
|
||||||
{
|
|
||||||
SURFACE_LockBitmapBits(psurfDest);
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead,
|
// FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead,
|
||||||
// mark the copy block function to be DrvCopyBits instead of the
|
// mark the copy block function to be DrvCopyBits instead of the
|
||||||
|
@ -180,12 +174,6 @@ EngCopyBits(SURFOBJ *psoDest,
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (psoDest != psoSource)
|
|
||||||
{
|
|
||||||
SURFACE_UnlockBitmapBits(psurfDest);
|
|
||||||
}
|
|
||||||
SURFACE_UnlockBitmapBits(psurfSource);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -548,7 +548,6 @@ IntEngGradientFill(
|
||||||
psurf = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
psurf = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||||
ASSERT(psurf);
|
ASSERT(psurf);
|
||||||
|
|
||||||
SURFACE_LockBitmapBits(psurf);
|
|
||||||
if(psurf->flHooks & HOOK_GRADIENTFILL)
|
if(psurf->flHooks & HOOK_GRADIENTFILL)
|
||||||
{
|
{
|
||||||
Ret = GDIDEVFUNCS(psoDest).GradientFill(
|
Ret = GDIDEVFUNCS(psoDest).GradientFill(
|
||||||
|
@ -560,7 +559,6 @@ IntEngGradientFill(
|
||||||
Ret = EngGradientFill(psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, prclExtents,
|
Ret = EngGradientFill(psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, prclExtents,
|
||||||
pptlDitherOrg, ulMode);
|
pptlDitherOrg, ulMode);
|
||||||
}
|
}
|
||||||
SURFACE_UnlockBitmapBits(psurf);
|
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -565,8 +565,6 @@ IntEngLineTo(SURFOBJ *psoDest,
|
||||||
if (b.left == b.right) b.right++;
|
if (b.left == b.right) b.right++;
|
||||||
if (b.top == b.bottom) b.bottom++;
|
if (b.top == b.bottom) b.bottom++;
|
||||||
|
|
||||||
SURFACE_LockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
if (psurfDest->flHooks & HOOK_LINETO)
|
if (psurfDest->flHooks & HOOK_LINETO)
|
||||||
{
|
{
|
||||||
/* Call the driver's DrvLineTo */
|
/* Call the driver's DrvLineTo */
|
||||||
|
@ -586,8 +584,6 @@ IntEngLineTo(SURFOBJ *psoDest,
|
||||||
ret = EngLineTo(psoDest, ClipObj, pbo, x1, y1, x2, y2, RectBounds, Mix);
|
ret = EngLineTo(psoDest, ClipObj, pbo, x1, y1, x2, y2, RectBounds, Mix);
|
||||||
}
|
}
|
||||||
|
|
||||||
SURFACE_UnlockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -540,14 +540,13 @@ IntEngMovePointer(
|
||||||
IN LONG y,
|
IN LONG y,
|
||||||
IN RECTL *prcl)
|
IN RECTL *prcl)
|
||||||
{
|
{
|
||||||
SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
|
|
||||||
PPDEVOBJ ppdev = (PPDEVOBJ)pso->hdev;
|
PPDEVOBJ ppdev = (PPDEVOBJ)pso->hdev;
|
||||||
if(ppdev->SafetyRemoveLevel)
|
if(ppdev->SafetyRemoveLevel)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
SURFACE_LockBitmapBits(psurf);
|
EngAcquireSemaphore(ppdev->hsemDevLock);
|
||||||
ppdev->pfnMovePointer(pso, x, y, prcl);
|
ppdev->pfnMovePointer(pso, x, y, prcl);
|
||||||
SURFACE_UnlockBitmapBits(psurf);
|
EngReleaseSemaphore(ppdev->hsemDevLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG APIENTRY
|
ULONG APIENTRY
|
||||||
|
@ -564,13 +563,12 @@ IntEngSetPointerShape(
|
||||||
IN FLONG fl)
|
IN FLONG fl)
|
||||||
{
|
{
|
||||||
ULONG ulResult = SPS_DECLINE;
|
ULONG ulResult = SPS_DECLINE;
|
||||||
SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
|
|
||||||
PFN_DrvSetPointerShape pfnSetPointerShape;
|
PFN_DrvSetPointerShape pfnSetPointerShape;
|
||||||
PPDEVOBJ ppdev = GDIDEV(pso);
|
PPDEVOBJ ppdev = GDIDEV(pso);
|
||||||
|
|
||||||
pfnSetPointerShape = GDIDEVFUNCS(pso).SetPointerShape;
|
pfnSetPointerShape = GDIDEVFUNCS(pso).SetPointerShape;
|
||||||
|
|
||||||
SURFACE_LockBitmapBits(psurf);
|
EngAcquireSemaphore(ppdev->hsemDevLock);
|
||||||
if (pfnSetPointerShape)
|
if (pfnSetPointerShape)
|
||||||
{
|
{
|
||||||
ulResult = pfnSetPointerShape(pso,
|
ulResult = pfnSetPointerShape(pso,
|
||||||
|
@ -608,7 +606,7 @@ IntEngSetPointerShape(
|
||||||
ppdev->pfnMovePointer = EngMovePointer;
|
ppdev->pfnMovePointer = EngMovePointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
SURFACE_UnlockBitmapBits(psurf);
|
EngReleaseSemaphore(ppdev->hsemDevLock);
|
||||||
|
|
||||||
return ulResult;
|
return ulResult;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
static BOOL APIENTRY FillSolidUnlocked(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
|
BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
|
||||||
{
|
{
|
||||||
LONG y;
|
LONG y;
|
||||||
ULONG LineWidth;
|
ULONG LineWidth;
|
||||||
|
@ -41,7 +41,6 @@ static BOOL APIENTRY FillSolidUnlocked(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
|
||||||
ASSERT(pso);
|
ASSERT(pso);
|
||||||
ASSERT(pRect);
|
ASSERT(pRect);
|
||||||
psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
|
psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
|
||||||
MouseSafetyOnDrawStart(pso, pRect->left, pRect->top, pRect->right, pRect->bottom);
|
|
||||||
LineWidth = pRect->right - pRect->left;
|
LineWidth = pRect->right - pRect->left;
|
||||||
DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth, pRect->top, pRect->bottom);
|
DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth, pRect->top, pRect->bottom);
|
||||||
for (y = pRect->top; y < pRect->bottom; y++)
|
for (y = pRect->top; y < pRect->bottom; y++)
|
||||||
|
@ -49,22 +48,9 @@ static BOOL APIENTRY FillSolidUnlocked(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
|
||||||
DibFunctionsForBitmapFormat[pso->iBitmapFormat].DIB_HLine(
|
DibFunctionsForBitmapFormat[pso->iBitmapFormat].DIB_HLine(
|
||||||
pso, pRect->left, pRect->right, y, iColor);
|
pso, pRect->left, pRect->right, y, iColor);
|
||||||
}
|
}
|
||||||
MouseSafetyOnDrawEnd(pso);
|
|
||||||
|
|
||||||
return TRUE;
|
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
|
BOOL APIENTRY
|
||||||
EngPaintRgn(SURFOBJ *pso, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
EngPaintRgn(SURFOBJ *pso, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
||||||
BRUSHOBJ *BrushObj, POINTL *BrushPoint)
|
BRUSHOBJ *BrushObj, POINTL *BrushPoint)
|
||||||
|
@ -87,7 +73,7 @@ EngPaintRgn(SURFOBJ *pso, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
||||||
|
|
||||||
if (ClipRegion->iDComplexity == DC_RECT)
|
if (ClipRegion->iDComplexity == DC_RECT)
|
||||||
{
|
{
|
||||||
FillSolidUnlocked(pso, &(ClipRegion->rclBounds), iColor);
|
FillSolid(pso, &(ClipRegion->rclBounds), iColor);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* Enumerate all the rectangles and draw them */
|
/* Enumerate all the rectangles and draw them */
|
||||||
|
@ -96,7 +82,7 @@ EngPaintRgn(SURFOBJ *pso, CLIPOBJ *ClipRegion, ULONG iColor, MIX Mix,
|
||||||
do {
|
do {
|
||||||
EnumMore = CLIPOBJ_bEnum(ClipRegion, sizeof(RectEnum), (PVOID) &RectEnum);
|
EnumMore = CLIPOBJ_bEnum(ClipRegion, sizeof(RectEnum), (PVOID) &RectEnum);
|
||||||
for (i = 0; i < RectEnum.c; i++) {
|
for (i = 0; i < RectEnum.c; i++) {
|
||||||
FillSolidUnlocked(pso, RectEnum.arcl + i, iColor);
|
FillSolid(pso, RectEnum.arcl + i, iColor);
|
||||||
}
|
}
|
||||||
} while (EnumMore);
|
} while (EnumMore);
|
||||||
}
|
}
|
||||||
|
@ -141,11 +127,8 @@ IntEngPaint(IN SURFOBJ *pso,
|
||||||
if((pso->iType!=STYPE_BITMAP) && (psurf->flHooks & HOOK_PAINT))
|
if((pso->iType!=STYPE_BITMAP) && (psurf->flHooks & HOOK_PAINT))
|
||||||
{
|
{
|
||||||
// Call the driver's DrvPaint
|
// Call the driver's DrvPaint
|
||||||
SURFACE_LockBitmapBits(psurf);
|
|
||||||
|
|
||||||
ret = GDIDEVFUNCS(pso).Paint(
|
ret = GDIDEVFUNCS(pso).Paint(
|
||||||
pso, ClipRegion, Brush, BrushOrigin, Mix);
|
pso, ClipRegion, Brush, BrushOrigin, Mix);
|
||||||
SURFACE_UnlockBitmapBits(psurf);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
return EngPaint(pso, ClipRegion, Brush, BrushOrigin, Mix );
|
return EngPaint(pso, ClipRegion, Brush, BrushOrigin, Mix );
|
||||||
|
|
|
@ -373,15 +373,12 @@ PDEVOBJ_bSwitchMode(
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(pSurface->BitsLock);
|
|
||||||
|
|
||||||
/* 4. Get DirectDraw information */
|
/* 4. Get DirectDraw information */
|
||||||
/* 5. Enable DirectDraw Not traced */
|
/* 5. Enable DirectDraw Not traced */
|
||||||
/* 6. Copy old PDEV state to new PDEV instance */
|
/* 6. Copy old PDEV state to new PDEV instance */
|
||||||
|
|
||||||
/* 7. Switch the PDEVs */
|
/* 7. Switch the PDEVs */
|
||||||
PDEVOBJ_vSwitchPdev(ppdev, ppdevTmp);
|
PDEVOBJ_vSwitchPdev(ppdev, ppdevTmp);
|
||||||
ASSERT(ppdev->pSurface->BitsLock);
|
|
||||||
|
|
||||||
/* 8. Disable DirectDraw */
|
/* 8. Disable DirectDraw */
|
||||||
|
|
||||||
|
@ -395,7 +392,6 @@ leave:
|
||||||
EngReleaseSemaphore(ghsemPDEV);
|
EngReleaseSemaphore(ghsemPDEV);
|
||||||
|
|
||||||
DPRINT1("leave, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
|
DPRINT1("leave, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
|
||||||
ASSERT(ppdev->pSurface->BitsLock);
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -462,15 +462,10 @@ IntEngStretchBlt(SURFOBJ *psoDest,
|
||||||
|
|
||||||
/* No success yet */
|
/* No success yet */
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
SURFACE_LockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
if (UsesSource)
|
if (UsesSource)
|
||||||
{
|
{
|
||||||
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
||||||
if (psoSource != psoDest)
|
|
||||||
{
|
|
||||||
SURFACE_LockBitmapBits(psurfSource);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare color adjustment */
|
/* Prepare color adjustment */
|
||||||
|
@ -510,15 +505,6 @@ IntEngStretchBlt(SURFOBJ *psoDest,
|
||||||
ROP);
|
ROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UsesSource)
|
|
||||||
{
|
|
||||||
if (psoSource != psoDest)
|
|
||||||
{
|
|
||||||
SURFACE_UnlockBitmapBits(psurfSource);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SURFACE_UnlockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,42 +136,9 @@ SURFACE_Cleanup(PVOID ObjectBody)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != psurf->BitsLock)
|
|
||||||
{
|
|
||||||
ExFreePoolWithTag(psurf->BitsLock, TAG_SURFACE);
|
|
||||||
psurf->BitsLock = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL INTERNAL_CALL
|
|
||||||
SURFACE_InitBitsLock(PSURFACE psurf)
|
|
||||||
{
|
|
||||||
psurf->BitsLock = ExAllocatePoolWithTag(NonPagedPool,
|
|
||||||
sizeof(FAST_MUTEX),
|
|
||||||
TAG_SURFACE);
|
|
||||||
if (NULL == psurf->BitsLock)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExInitializeFastMutex(psurf->BitsLock);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void INTERNAL_CALL
|
|
||||||
SURFACE_CleanupBitsLock(PSURFACE psurf)
|
|
||||||
{
|
|
||||||
if (NULL != psurf->BitsLock)
|
|
||||||
{
|
|
||||||
ExFreePoolWithTag(psurf->BitsLock, TAG_SURFACE);
|
|
||||||
psurf->BitsLock = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -348,12 +315,6 @@ IntCreateBitmap(IN SIZEL Size,
|
||||||
}
|
}
|
||||||
hbmp = psurf->BaseObject.hHmgr;
|
hbmp = psurf->BaseObject.hHmgr;
|
||||||
|
|
||||||
if (! SURFACE_InitBitsLock(psurf))
|
|
||||||
{
|
|
||||||
SURFACE_UnlockSurface(psurf);
|
|
||||||
SURFACE_FreeSurfaceByHandle(hbmp);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
pso = &psurf->SurfObj;
|
pso = &psurf->SurfObj;
|
||||||
|
|
||||||
if (Format == BMF_4RLE)
|
if (Format == BMF_4RLE)
|
||||||
|
@ -567,15 +528,6 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lock down the surface */
|
|
||||||
if (!SURFACE_InitBitsLock(psurf))
|
|
||||||
{
|
|
||||||
/* Bail out if that failed */
|
|
||||||
SURFACE_UnlockSurface(psurf);
|
|
||||||
SURFACE_FreeSurfaceByHandle(psurf->BaseObject.hHmgr);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We should now have our surface object */
|
/* We should now have our surface object */
|
||||||
pso = &psurf->SurfObj;
|
pso = &psurf->SurfObj;
|
||||||
|
|
||||||
|
@ -731,12 +683,6 @@ EngCreateDeviceSurface(IN DHSURF dhsurf,
|
||||||
hsurf = psurf->BaseObject.hHmgr;
|
hsurf = psurf->BaseObject.hHmgr;
|
||||||
GDIOBJ_SetOwnership(hsurf, NULL);
|
GDIOBJ_SetOwnership(hsurf, NULL);
|
||||||
|
|
||||||
if (!SURFACE_InitBitsLock(psurf))
|
|
||||||
{
|
|
||||||
SURFACE_UnlockSurface(psurf);
|
|
||||||
SURFACE_FreeSurfaceByHandle(hsurf);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
pso = &psurf->SurfObj;
|
pso = &psurf->SurfObj;
|
||||||
|
|
||||||
pso->dhsurf = dhsurf;
|
pso->dhsurf = dhsurf;
|
||||||
|
|
|
@ -284,12 +284,6 @@ IntEngTransparentBlt(SURFOBJ *psoDest,
|
||||||
OutputRect = InputClippedRect;
|
OutputRect = InputClippedRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(psoSource != psoDest)
|
|
||||||
{
|
|
||||||
SURFACE_LockBitmapBits(psurfSource);
|
|
||||||
}
|
|
||||||
SURFACE_LockBitmapBits(psurfDest);
|
|
||||||
|
|
||||||
if(psurfDest->flHooks & HOOK_TRANSPARENTBLT)
|
if(psurfDest->flHooks & HOOK_TRANSPARENTBLT)
|
||||||
{
|
{
|
||||||
Ret = GDIDEVFUNCS(psoDest).TransparentBlt(
|
Ret = GDIDEVFUNCS(psoDest).TransparentBlt(
|
||||||
|
@ -305,12 +299,6 @@ IntEngTransparentBlt(SURFOBJ *psoDest,
|
||||||
&OutputRect, &InputRect, iTransColor, Reserved);
|
&OutputRect, &InputRect, iTransColor, Reserved);
|
||||||
}
|
}
|
||||||
|
|
||||||
SURFACE_UnlockBitmapBits(psurfDest);
|
|
||||||
if(psoSource != psoDest)
|
|
||||||
{
|
|
||||||
SURFACE_UnlockBitmapBits(psurfSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,6 @@ typedef struct _SURFACE
|
||||||
DWORD dwOffset;
|
DWORD dwOffset;
|
||||||
|
|
||||||
/* reactos specific */
|
/* reactos specific */
|
||||||
PFAST_MUTEX BitsLock; /* You need to hold this lock before you touch
|
|
||||||
the actual bits in the bitmap */
|
|
||||||
HPALETTE hDIBPalette;
|
HPALETTE hDIBPalette;
|
||||||
DWORD dsBitfields[3]; // hack, should probably use palette instead
|
DWORD dsBitfields[3]; // hack, should probably use palette instead
|
||||||
DWORD biClrUsed;
|
DWORD biClrUsed;
|
||||||
|
@ -64,12 +62,7 @@ typedef struct _SURFACE
|
||||||
#define SURFACE_ShareUnlockSurface(pBMObj) \
|
#define SURFACE_ShareUnlockSurface(pBMObj) \
|
||||||
GDIOBJ_ShareUnlockObjByPtr ((POBJ)pBMObj)
|
GDIOBJ_ShareUnlockObjByPtr ((POBJ)pBMObj)
|
||||||
|
|
||||||
#define SURFACE_LockBitmapBits(pBMObj) ExEnterCriticalRegionAndAcquireFastMutexUnsafe((pBMObj)->BitsLock)
|
|
||||||
#define SURFACE_UnlockBitmapBits(pBMObj) ExReleaseFastMutexUnsafeAndLeaveCriticalRegion((pBMObj)->BitsLock)
|
|
||||||
|
|
||||||
BOOL INTERNAL_CALL SURFACE_Cleanup(PVOID ObjectBody);
|
BOOL INTERNAL_CALL SURFACE_Cleanup(PVOID ObjectBody);
|
||||||
BOOL INTERNAL_CALL SURFACE_InitBitsLock(SURFACE *pBMObj);
|
|
||||||
void INTERNAL_CALL SURFACE_CleanupBitsLock(SURFACE *pBMObj);
|
|
||||||
|
|
||||||
#define GDIDEV(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev))
|
#define GDIDEV(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev))
|
||||||
#define GDIDEVFUNCS(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev))->DriverFunctions
|
#define GDIDEVFUNCS(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev))->DriverFunctions
|
||||||
|
|
Loading…
Reference in a new issue