mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:35:43 +00:00
[WIN32K]
- Use trivial Clip object, if NULL one is passed in IntEngAlphaBlend - In NtGdiDescribePixelFormat allow passing NULL for the output pixel descriptor and copy the result *to* the caller not from the caller. - Fix some format strings - Update some annotations svn path=/trunk/; revision=57013
This commit is contained in:
parent
716b77c63e
commit
74550e0567
6 changed files with 83 additions and 81 deletions
|
@ -192,49 +192,51 @@ EngAlphaBlend(IN SURFOBJ *psoDest,
|
|||
return Ret;
|
||||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
IntEngAlphaBlend(IN SURFOBJ *psoDest,
|
||||
IN SURFOBJ *psoSource,
|
||||
IN CLIPOBJ *ClipRegion,
|
||||
IN XLATEOBJ *ColorTranslation,
|
||||
IN PRECTL DestRect,
|
||||
IN PRECTL SourceRect,
|
||||
IN BLENDOBJ *BlendObj)
|
||||
BOOL
|
||||
APIENTRY
|
||||
IntEngAlphaBlend(
|
||||
_Inout_ SURFOBJ *psoDest,
|
||||
_In_ SURFOBJ *psoSource,
|
||||
_In_opt_ CLIPOBJ *pco,
|
||||
_In_opt_ XLATEOBJ *pxlo,
|
||||
_In_ RECTL *prclDest,
|
||||
_In_ RECTL *prclSrc,
|
||||
_In_ BLENDOBJ *pBlendObj)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
SURFACE *psurfDest;
|
||||
//SURFACE *psurfSource;
|
||||
|
||||
ASSERT(psoDest);
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
|
||||
ASSERT(psoSource);
|
||||
//psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
||||
ASSERT(prclDest);
|
||||
ASSERT(prclSrc);
|
||||
//ASSERT(pBlendObj);
|
||||
|
||||
ASSERT(DestRect);
|
||||
ASSERT(SourceRect);
|
||||
/* If no clip object is given, use trivial one */
|
||||
if (!pco) pco = &gxcoTrivial.ClipObj;
|
||||
|
||||
/* Check if there is anything to draw */
|
||||
if (ClipRegion != NULL &&
|
||||
(ClipRegion->rclBounds.left >= ClipRegion->rclBounds.right ||
|
||||
ClipRegion->rclBounds.top >= ClipRegion->rclBounds.bottom))
|
||||
if ((pco->rclBounds.left >= pco->rclBounds.right) ||
|
||||
(pco->rclBounds.top >= pco->rclBounds.bottom))
|
||||
{
|
||||
/* Nothing to do */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
|
||||
/* Call the driver's DrvAlphaBlend if available */
|
||||
if (psurfDest->flags & HOOK_ALPHABLEND)
|
||||
{
|
||||
ret = GDIDEVFUNCS(psoDest).AlphaBlend(
|
||||
psoDest, psoSource, ClipRegion, ColorTranslation,
|
||||
DestRect, SourceRect, BlendObj);
|
||||
psoDest, psoSource, pco, pxlo,
|
||||
prclDest, prclSrc, pBlendObj);
|
||||
}
|
||||
|
||||
if (! ret)
|
||||
if (!ret)
|
||||
{
|
||||
ret = EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation,
|
||||
DestRect, SourceRect, BlendObj);
|
||||
ret = EngAlphaBlend(psoDest, psoSource, pco, pxlo,
|
||||
prclDest, prclSrc, pBlendObj);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -291,14 +291,14 @@ EngpCreatePDEV(
|
|||
{
|
||||
/* ... use the device's default one */
|
||||
pdm = pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
|
||||
DPRINT("Using iDefaultMode = %ld\n", pGraphicsDevice->iDefaultMode);
|
||||
DPRINT("Using iDefaultMode = %lu\n", pGraphicsDevice->iDefaultMode);
|
||||
}
|
||||
|
||||
/* Try to get a diplay driver */
|
||||
ppdev->pldev = EngLoadImageEx(pdm->dmDeviceName, LDEV_DEVICE_DISPLAY);
|
||||
if (!ppdev->pldev)
|
||||
{
|
||||
DPRINT1("Could not load display driver '%ls', '%s'\n",
|
||||
DPRINT1("Could not load display driver '%ls', '%ls'\n",
|
||||
pGraphicsDevice->pDiplayDrivers,
|
||||
pdm->dmDeviceName);
|
||||
ExFreePoolWithTag(ppdev, GDITAG_PDEV);
|
||||
|
@ -617,18 +617,13 @@ APIENTRY
|
|||
EngGetDriverName(IN HDEV hdev)
|
||||
{
|
||||
PPDEVOBJ ppdev = (PPDEVOBJ)hdev;
|
||||
PLDEVOBJ pldev;
|
||||
|
||||
if (!hdev)
|
||||
return NULL;
|
||||
ASSERT(ppdev);
|
||||
ASSERT(ppdev->pldev);
|
||||
ASSERT(ppdev->pldev->pGdiDriverInfo);
|
||||
ASSERT(ppdev->pldev->pGdiDriverInfo->DriverName.Buffer);
|
||||
|
||||
pldev = ppdev->pldev;
|
||||
ASSERT(pldev);
|
||||
|
||||
if (!pldev->pGdiDriverInfo)
|
||||
return NULL;
|
||||
|
||||
return pldev->pGdiDriverInfo->DriverName.Buffer;
|
||||
return ppdev->pldev->pGdiDriverInfo->DriverName.Buffer;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -57,12 +57,17 @@ IntArc( DC *dc,
|
|||
{
|
||||
INT tmp = Bottom; Bottom = Top; Top = tmp;
|
||||
}
|
||||
if ((Left == Right) ||
|
||||
(Top == Bottom) ||
|
||||
(((arctype != GdiTypeArc) || (arctype != GdiTypeArcTo)) &&
|
||||
((Right - Left == 1) ||
|
||||
(Bottom - Top == 1))))
|
||||
return TRUE;
|
||||
|
||||
/* Check if the target rect is empty */
|
||||
if ((Left == Right) || (Top == Bottom)) return TRUE;
|
||||
|
||||
// FIXME: this needs to be verified
|
||||
if ((arctype == GdiTypeChord ) || (arctype == GdiTypePie))
|
||||
{
|
||||
if ((Right - Left == 1) || (Bottom - Top == 1))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
|
|
|
@ -332,13 +332,13 @@ NtGdiGetDCDword(
|
|||
return Ret;
|
||||
}
|
||||
|
||||
BOOL
|
||||
BOOL _Success_(return != FALSE)
|
||||
APIENTRY
|
||||
NtGdiGetAndSetDCDword(
|
||||
HDC hDC,
|
||||
UINT u,
|
||||
DWORD dwIn,
|
||||
DWORD *Result)
|
||||
_In_ HDC hdc,
|
||||
_In_ UINT u,
|
||||
_In_ DWORD dwIn,
|
||||
_Out_ DWORD *pdwResult)
|
||||
{
|
||||
BOOL Ret = TRUE;
|
||||
PDC pdc;
|
||||
|
@ -347,13 +347,13 @@ NtGdiGetAndSetDCDword(
|
|||
DWORD SafeResult = 0;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
if (!Result)
|
||||
if (!pdwResult)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pdc = DC_LockDc(hDC);
|
||||
pdc = DC_LockDc(hdc);
|
||||
if (!pdc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
|
@ -442,8 +442,8 @@ NtGdiGetAndSetDCDword(
|
|||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(Result, sizeof(DWORD), 1);
|
||||
*Result = SafeResult;
|
||||
ProbeForWrite(pdwResult, sizeof(DWORD), 1);
|
||||
*pdwResult = SafeResult;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
|
|
@ -38,23 +38,23 @@ IntGetipfdDevMax(PDC pdc)
|
|||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
_Success_(return != 0)
|
||||
INT
|
||||
APIENTRY
|
||||
NtGdiDescribePixelFormat(HDC hDC,
|
||||
INT PixelFormat,
|
||||
UINT BufSize,
|
||||
LPPIXELFORMATDESCRIPTOR pfd)
|
||||
NtGdiDescribePixelFormat(
|
||||
_In_ HDC hdc,
|
||||
_In_ INT ipfd,
|
||||
_In_ UINT cjpfd,
|
||||
_When_(cjpfd != 0, _Out_) PPIXELFORMATDESCRIPTOR ppfd)
|
||||
{
|
||||
PDC pdc;
|
||||
PPDEVOBJ ppdev;
|
||||
INT Ret = 0;
|
||||
PIXELFORMATDESCRIPTOR pfdSafe;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
if (!BufSize) return 0;
|
||||
if ((ppfd == NULL) && (cjpfd != 0)) return 0;
|
||||
|
||||
pdc = DC_LockDc(hDC);
|
||||
pdc = DC_LockDc(hdc);
|
||||
if (!pdc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
|
@ -63,9 +63,7 @@ NtGdiDescribePixelFormat(HDC hDC,
|
|||
|
||||
if (!pdc->ipfdDevMax) IntGetipfdDevMax(pdc);
|
||||
|
||||
if ( BufSize < sizeof(PIXELFORMATDESCRIPTOR) ||
|
||||
PixelFormat < 1 ||
|
||||
PixelFormat > pdc->ipfdDevMax )
|
||||
if ((ipfd < 1) || (ipfd > pdc->ipfdDevMax))
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||
goto Exit;
|
||||
|
@ -83,25 +81,25 @@ NtGdiDescribePixelFormat(HDC hDC,
|
|||
{
|
||||
Ret = ppdev->DriverFunctions.DescribePixelFormat(
|
||||
ppdev->dhpdev,
|
||||
PixelFormat,
|
||||
sizeof(PIXELFORMATDESCRIPTOR),
|
||||
ipfd,
|
||||
sizeof(pfdSafe),
|
||||
&pfdSafe);
|
||||
}
|
||||
|
||||
_SEH2_TRY
|
||||
if (Ret && cjpfd)
|
||||
{
|
||||
ProbeForWrite( pfd,
|
||||
sizeof(PIXELFORMATDESCRIPTOR),
|
||||
1);
|
||||
RtlCopyMemory(&pfdSafe, pfd, sizeof(PIXELFORMATDESCRIPTOR));
|
||||
_SEH2_TRY
|
||||
{
|
||||
cjpfd = min(cjpfd, sizeof(PIXELFORMATDESCRIPTOR));
|
||||
ProbeForWrite(ppfd, cjpfd, 1);
|
||||
RtlCopyMemory(ppfd, &pfdSafe, cjpfd);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
SetLastNtError(_SEH2_GetExceptionCode());
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
if (!NT_SUCCESS(Status)) SetLastNtError(Status);
|
||||
|
||||
Exit:
|
||||
DC_UnlockDc(pdc);
|
||||
|
|
|
@ -48,8 +48,10 @@ UserAddCallProcToClass(IN OUT PCLS Class,
|
|||
IN PCALLPROCDATA CallProc);
|
||||
|
||||
BOOL
|
||||
IntGetAtomFromStringOrAtom(IN PUNICODE_STRING ClassName,
|
||||
OUT RTL_ATOM *Atom);
|
||||
NTAPI
|
||||
IntGetAtomFromStringOrAtom(
|
||||
_In_ PUNICODE_STRING ClassName,
|
||||
_Out_ RTL_ATOM *Atom);
|
||||
|
||||
BOOL
|
||||
IntCheckProcessDesktopClasses(IN PDESKTOP Desktop,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue