mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:05:43 +00:00
[WIN32K]
Fix handling of mask bitmap in NtGdiMaskBlt svn path=/trunk/; revision=66230
This commit is contained in:
parent
ab543f2e54
commit
88cc747e0b
1 changed files with 13 additions and 20 deletions
|
@ -324,51 +324,44 @@ NtGdiMaskBlt(
|
||||||
BOOL Status = FALSE;
|
BOOL Status = FALSE;
|
||||||
EXLATEOBJ exlo;
|
EXLATEOBJ exlo;
|
||||||
XLATEOBJ *XlateObj = NULL;
|
XLATEOBJ *XlateObj = NULL;
|
||||||
BOOL UsesSource = ROP_USES_SOURCE(dwRop);
|
BOOL UsesSource;
|
||||||
BOOL UsesMask;
|
|
||||||
|
|
||||||
FIXUP_ROP(dwRop);
|
FIXUP_ROP(dwRop); // FIXME: why do we need this???
|
||||||
|
|
||||||
UsesMask = ROP_USES_MASK(dwRop);
|
|
||||||
|
|
||||||
//DPRINT1("dwRop : 0x%08x\n", dwRop);
|
//DPRINT1("dwRop : 0x%08x\n", dwRop);
|
||||||
|
UsesSource = ROP_USES_SOURCE(dwRop);
|
||||||
if (!hdcDest || (UsesSource && !hdcSrc))
|
if (!hdcDest || (UsesSource && !hdcSrc))
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Take care of mask bitmap */
|
/* Check if we need a mask and have a mask bitmap */
|
||||||
if(hbmMask)
|
if (ROP_USES_MASK(dwRop) && (hbmMask != NULL))
|
||||||
{
|
{
|
||||||
|
/* Reference the mask bitmap */
|
||||||
psurfMask = SURFACE_ShareLockSurface(hbmMask);
|
psurfMask = SURFACE_ShareLockSurface(hbmMask);
|
||||||
if(!psurfMask)
|
if (psurfMask == NULL)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(UsesMask)
|
/* Make sure the mask bitmap is 1 BPP */
|
||||||
{
|
if (gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1)
|
||||||
if(!psurfMask)
|
|
||||||
{
|
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if(gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1)
|
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
SURFACE_ShareUnlockSurface(psurfMask);
|
SURFACE_ShareUnlockSurface(psurfMask);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(psurfMask)
|
else
|
||||||
{
|
{
|
||||||
WARN("Getting Mask bitmap without needing it?\n");
|
/* We use NULL, if we need a mask, the Eng function will take care of
|
||||||
SURFACE_ShareUnlockSurface(psurfMask);
|
that and use the brushobject to get a mask */
|
||||||
psurfMask = NULL;
|
psurfMask = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaskPoint.x = xMask;
|
MaskPoint.x = xMask;
|
||||||
MaskPoint.y = yMask;
|
MaskPoint.y = yMask;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue