mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 20:41:59 +00:00
[WIN32K]
Implement DC_bIsBitmapCompatible() helper function and use it in NtGdiSelectBitmap. Will be reused later. [SPEC2DEF] Improve formatting svn path=/trunk/; revision=64426
This commit is contained in:
parent
dc5a81e32e
commit
c9143ec6b0
2 changed files with 25 additions and 6 deletions
|
@ -604,7 +604,8 @@ OutputLine_def_GCC(FILE *fileDest, EXPORT *pexp)
|
||||||
/* C++ stubs are forwarded to C stubs */
|
/* C++ stubs are forwarded to C stubs */
|
||||||
fprintf(fileDest, "=stub_function%d", pexp->nNumber);
|
fprintf(fileDest, "=stub_function%d", pexp->nNumber);
|
||||||
}
|
}
|
||||||
else if (gbTracing && ((pexp->uFlags & FL_NORELAY) == 0) && (pexp->nCallingConvention == CC_STDCALL) &&
|
else if (gbTracing && ((pexp->uFlags & FL_NORELAY) == 0) &&
|
||||||
|
(pexp->nCallingConvention == CC_STDCALL) &&
|
||||||
(pexp->strName.buf[0] != '?'))
|
(pexp->strName.buf[0] != '?'))
|
||||||
{
|
{
|
||||||
/* Redirect it to the relay-tracing trampoline */
|
/* Redirect it to the relay-tracing trampoline */
|
||||||
|
|
|
@ -318,6 +318,28 @@ NtGdiSelectPen(
|
||||||
return hOrgPen;
|
return hOrgPen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
NTAPI
|
||||||
|
DC_bIsBitmapCompatible(PDC pdc, PSURFACE psurf)
|
||||||
|
{
|
||||||
|
ULONG cBitsPixel;
|
||||||
|
|
||||||
|
/* Must be an API bitmap */
|
||||||
|
if (!(psurf->flags & API_BITMAP)) return FALSE;
|
||||||
|
|
||||||
|
/* DIB sections are always compatible */
|
||||||
|
if (psurf->hSecure != NULL) return TRUE;
|
||||||
|
|
||||||
|
/* Get the bit depth of the bitmap */
|
||||||
|
cBitsPixel = gajBitsPerFormat[psurf->SurfObj.iBitmapFormat];
|
||||||
|
|
||||||
|
/* 1 BPP is compatible */
|
||||||
|
if ((cBitsPixel == 1) || (cBitsPixel == pdc->ppdev->gdiinfo.cBitsPixel))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -332,7 +354,6 @@ NtGdiSelectBitmap(
|
||||||
PSURFACE psurfNew, psurfOld;
|
PSURFACE psurfNew, psurfOld;
|
||||||
PREGION VisRgn;
|
PREGION VisRgn;
|
||||||
HDC hdcOld;
|
HDC hdcOld;
|
||||||
ULONG cBitsPixel;
|
|
||||||
ASSERT_NOGDILOCKS();
|
ASSERT_NOGDILOCKS();
|
||||||
|
|
||||||
/* Verify parameters */
|
/* Verify parameters */
|
||||||
|
@ -395,10 +416,7 @@ NtGdiSelectBitmap(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the bitmap is compatile with the dc */
|
/* Check if the bitmap is compatile with the dc */
|
||||||
cBitsPixel = gajBitsPerFormat[psurfNew->SurfObj.iBitmapFormat];
|
if (!DC_bIsBitmapCompatible(pdc, psurfNew))
|
||||||
if ((cBitsPixel != 1) &&
|
|
||||||
(cBitsPixel != pdc->ppdev->gdiinfo.cBitsPixel) &&
|
|
||||||
(psurfNew->hSecure == NULL))
|
|
||||||
{
|
{
|
||||||
/* Dereference the bitmap, unlock the DC and fail. */
|
/* Dereference the bitmap, unlock the DC and fail. */
|
||||||
SURFACE_ShareUnlockSurface(psurfNew);
|
SURFACE_ShareUnlockSurface(psurfNew);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue