mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 01:15:42 +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
|
@ -141,7 +141,7 @@ EngAlphaBlend(IN SURFOBJ *psoDest,
|
||||||
Rect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top);
|
Rect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top);
|
||||||
Rect.bottom = InputRect.bottom + (CombinedRect.bottom - OutputRect.bottom) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top);
|
Rect.bottom = InputRect.bottom + (CombinedRect.bottom - OutputRect.bottom) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top);
|
||||||
ASSERT(InputRect.left < InputRect.right && InputRect.top < InputRect.bottom);
|
ASSERT(InputRect.left < InputRect.right && InputRect.top < InputRect.bottom);
|
||||||
|
|
||||||
/* Aplha blend one rect */
|
/* Aplha blend one rect */
|
||||||
Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend(
|
Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend(
|
||||||
OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj);
|
OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj);
|
||||||
|
@ -170,7 +170,7 @@ EngAlphaBlend(IN SURFOBJ *psoDest,
|
||||||
Rect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top);
|
Rect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top);
|
||||||
Rect.bottom = InputRect.bottom + (CombinedRect.bottom - OutputRect.bottom) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top);
|
Rect.bottom = InputRect.bottom + (CombinedRect.bottom - OutputRect.bottom) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top);
|
||||||
ASSERT(InputRect.left < InputRect.right && InputRect.top < InputRect.bottom);
|
ASSERT(InputRect.left < InputRect.right && InputRect.top < InputRect.bottom);
|
||||||
|
|
||||||
/* Alpha blend one rect */
|
/* Alpha blend one rect */
|
||||||
Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend(
|
Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend(
|
||||||
OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj) && Ret;
|
OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj) && Ret;
|
||||||
|
@ -192,49 +192,51 @@ EngAlphaBlend(IN SURFOBJ *psoDest,
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL APIENTRY
|
BOOL
|
||||||
IntEngAlphaBlend(IN SURFOBJ *psoDest,
|
APIENTRY
|
||||||
IN SURFOBJ *psoSource,
|
IntEngAlphaBlend(
|
||||||
IN CLIPOBJ *ClipRegion,
|
_Inout_ SURFOBJ *psoDest,
|
||||||
IN XLATEOBJ *ColorTranslation,
|
_In_ SURFOBJ *psoSource,
|
||||||
IN PRECTL DestRect,
|
_In_opt_ CLIPOBJ *pco,
|
||||||
IN PRECTL SourceRect,
|
_In_opt_ XLATEOBJ *pxlo,
|
||||||
IN BLENDOBJ *BlendObj)
|
_In_ RECTL *prclDest,
|
||||||
|
_In_ RECTL *prclSrc,
|
||||||
|
_In_ BLENDOBJ *pBlendObj)
|
||||||
{
|
{
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
SURFACE *psurfDest;
|
SURFACE *psurfDest;
|
||||||
//SURFACE *psurfSource;
|
|
||||||
|
|
||||||
ASSERT(psoDest);
|
ASSERT(psoDest);
|
||||||
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
|
||||||
|
|
||||||
ASSERT(psoSource);
|
ASSERT(psoSource);
|
||||||
//psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
|
ASSERT(prclDest);
|
||||||
|
ASSERT(prclSrc);
|
||||||
|
//ASSERT(pBlendObj);
|
||||||
|
|
||||||
ASSERT(DestRect);
|
/* If no clip object is given, use trivial one */
|
||||||
ASSERT(SourceRect);
|
if (!pco) pco = &gxcoTrivial.ClipObj;
|
||||||
|
|
||||||
/* Check if there is anything to draw */
|
/* Check if there is anything to draw */
|
||||||
if (ClipRegion != NULL &&
|
if ((pco->rclBounds.left >= pco->rclBounds.right) ||
|
||||||
(ClipRegion->rclBounds.left >= ClipRegion->rclBounds.right ||
|
(pco->rclBounds.top >= pco->rclBounds.bottom))
|
||||||
ClipRegion->rclBounds.top >= ClipRegion->rclBounds.bottom))
|
|
||||||
{
|
{
|
||||||
/* Nothing to do */
|
/* Nothing to do */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||||
|
|
||||||
/* Call the driver's DrvAlphaBlend if available */
|
/* Call the driver's DrvAlphaBlend if available */
|
||||||
if (psurfDest->flags & HOOK_ALPHABLEND)
|
if (psurfDest->flags & HOOK_ALPHABLEND)
|
||||||
{
|
{
|
||||||
ret = GDIDEVFUNCS(psoDest).AlphaBlend(
|
ret = GDIDEVFUNCS(psoDest).AlphaBlend(
|
||||||
psoDest, psoSource, ClipRegion, ColorTranslation,
|
psoDest, psoSource, pco, pxlo,
|
||||||
DestRect, SourceRect, BlendObj);
|
prclDest, prclSrc, pBlendObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
ret = EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation,
|
ret = EngAlphaBlend(psoDest, psoSource, pco, pxlo,
|
||||||
DestRect, SourceRect, BlendObj);
|
prclDest, prclSrc, pBlendObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -291,14 +291,14 @@ EngpCreatePDEV(
|
||||||
{
|
{
|
||||||
/* ... use the device's default one */
|
/* ... use the device's default one */
|
||||||
pdm = pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
|
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 */
|
/* Try to get a diplay driver */
|
||||||
ppdev->pldev = EngLoadImageEx(pdm->dmDeviceName, LDEV_DEVICE_DISPLAY);
|
ppdev->pldev = EngLoadImageEx(pdm->dmDeviceName, LDEV_DEVICE_DISPLAY);
|
||||||
if (!ppdev->pldev)
|
if (!ppdev->pldev)
|
||||||
{
|
{
|
||||||
DPRINT1("Could not load display driver '%ls', '%s'\n",
|
DPRINT1("Could not load display driver '%ls', '%ls'\n",
|
||||||
pGraphicsDevice->pDiplayDrivers,
|
pGraphicsDevice->pDiplayDrivers,
|
||||||
pdm->dmDeviceName);
|
pdm->dmDeviceName);
|
||||||
ExFreePoolWithTag(ppdev, GDITAG_PDEV);
|
ExFreePoolWithTag(ppdev, GDITAG_PDEV);
|
||||||
|
@ -617,18 +617,13 @@ APIENTRY
|
||||||
EngGetDriverName(IN HDEV hdev)
|
EngGetDriverName(IN HDEV hdev)
|
||||||
{
|
{
|
||||||
PPDEVOBJ ppdev = (PPDEVOBJ)hdev;
|
PPDEVOBJ ppdev = (PPDEVOBJ)hdev;
|
||||||
PLDEVOBJ pldev;
|
|
||||||
|
|
||||||
if (!hdev)
|
ASSERT(ppdev);
|
||||||
return NULL;
|
ASSERT(ppdev->pldev);
|
||||||
|
ASSERT(ppdev->pldev->pGdiDriverInfo);
|
||||||
|
ASSERT(ppdev->pldev->pGdiDriverInfo->DriverName.Buffer);
|
||||||
|
|
||||||
pldev = ppdev->pldev;
|
return ppdev->pldev->pGdiDriverInfo->DriverName.Buffer;
|
||||||
ASSERT(pldev);
|
|
||||||
|
|
||||||
if (!pldev->pGdiDriverInfo)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return pldev->pGdiDriverInfo->DriverName.Buffer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,12 +57,17 @@ IntArc( DC *dc,
|
||||||
{
|
{
|
||||||
INT tmp = Bottom; Bottom = Top; Top = tmp;
|
INT tmp = Bottom; Bottom = Top; Top = tmp;
|
||||||
}
|
}
|
||||||
if ((Left == Right) ||
|
|
||||||
(Top == Bottom) ||
|
/* Check if the target rect is empty */
|
||||||
(((arctype != GdiTypeArc) || (arctype != GdiTypeArcTo)) &&
|
if ((Left == Right) || (Top == Bottom)) return TRUE;
|
||||||
((Right - Left == 1) ||
|
|
||||||
(Bottom - Top == 1))))
|
// FIXME: this needs to be verified
|
||||||
return TRUE;
|
if ((arctype == GdiTypeChord ) || (arctype == GdiTypePie))
|
||||||
|
{
|
||||||
|
if ((Right - Left == 1) || (Bottom - Top == 1))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pdcattr = dc->pdcattr;
|
pdcattr = dc->pdcattr;
|
||||||
|
|
||||||
|
|
|
@ -332,13 +332,13 @@ NtGdiGetDCDword(
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL _Success_(return != FALSE)
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtGdiGetAndSetDCDword(
|
NtGdiGetAndSetDCDword(
|
||||||
HDC hDC,
|
_In_ HDC hdc,
|
||||||
UINT u,
|
_In_ UINT u,
|
||||||
DWORD dwIn,
|
_In_ DWORD dwIn,
|
||||||
DWORD *Result)
|
_Out_ DWORD *pdwResult)
|
||||||
{
|
{
|
||||||
BOOL Ret = TRUE;
|
BOOL Ret = TRUE;
|
||||||
PDC pdc;
|
PDC pdc;
|
||||||
|
@ -347,13 +347,13 @@ NtGdiGetAndSetDCDword(
|
||||||
DWORD SafeResult = 0;
|
DWORD SafeResult = 0;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
if (!Result)
|
if (!pdwResult)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdc = DC_LockDc(hDC);
|
pdc = DC_LockDc(hdc);
|
||||||
if (!pdc)
|
if (!pdc)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
@ -442,8 +442,8 @@ NtGdiGetAndSetDCDword(
|
||||||
{
|
{
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
ProbeForWrite(Result, sizeof(DWORD), 1);
|
ProbeForWrite(pdwResult, sizeof(DWORD), 1);
|
||||||
*Result = SafeResult;
|
*pdwResult = SafeResult;
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: subsystems/win32/win32k/objects/wingl.c
|
* FILE: subsystems/win32/win32k/objects/wingl.c
|
||||||
* PURPOSE: WinGL API
|
* PURPOSE: WinGL API
|
||||||
* PROGRAMMER:
|
* PROGRAMMER:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <win32k.h>
|
#include <win32k.h>
|
||||||
|
@ -38,23 +38,23 @@ IntGetipfdDevMax(PDC pdc)
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Success_(return != 0)
|
||||||
INT
|
INT
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtGdiDescribePixelFormat(HDC hDC,
|
NtGdiDescribePixelFormat(
|
||||||
INT PixelFormat,
|
_In_ HDC hdc,
|
||||||
UINT BufSize,
|
_In_ INT ipfd,
|
||||||
LPPIXELFORMATDESCRIPTOR pfd)
|
_In_ UINT cjpfd,
|
||||||
|
_When_(cjpfd != 0, _Out_) PPIXELFORMATDESCRIPTOR ppfd)
|
||||||
{
|
{
|
||||||
PDC pdc;
|
PDC pdc;
|
||||||
PPDEVOBJ ppdev;
|
PPDEVOBJ ppdev;
|
||||||
INT Ret = 0;
|
INT Ret = 0;
|
||||||
PIXELFORMATDESCRIPTOR pfdSafe;
|
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)
|
if (!pdc)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
@ -63,10 +63,8 @@ NtGdiDescribePixelFormat(HDC hDC,
|
||||||
|
|
||||||
if (!pdc->ipfdDevMax) IntGetipfdDevMax(pdc);
|
if (!pdc->ipfdDevMax) IntGetipfdDevMax(pdc);
|
||||||
|
|
||||||
if ( BufSize < sizeof(PIXELFORMATDESCRIPTOR) ||
|
if ((ipfd < 1) || (ipfd > pdc->ipfdDevMax))
|
||||||
PixelFormat < 1 ||
|
{
|
||||||
PixelFormat > pdc->ipfdDevMax )
|
|
||||||
{
|
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
@ -83,25 +81,25 @@ NtGdiDescribePixelFormat(HDC hDC,
|
||||||
{
|
{
|
||||||
Ret = ppdev->DriverFunctions.DescribePixelFormat(
|
Ret = ppdev->DriverFunctions.DescribePixelFormat(
|
||||||
ppdev->dhpdev,
|
ppdev->dhpdev,
|
||||||
PixelFormat,
|
ipfd,
|
||||||
sizeof(PIXELFORMATDESCRIPTOR),
|
sizeof(pfdSafe),
|
||||||
&pfdSafe);
|
&pfdSafe);
|
||||||
}
|
}
|
||||||
|
|
||||||
_SEH2_TRY
|
if (Ret && cjpfd)
|
||||||
{
|
{
|
||||||
ProbeForWrite( pfd,
|
_SEH2_TRY
|
||||||
sizeof(PIXELFORMATDESCRIPTOR),
|
{
|
||||||
1);
|
cjpfd = min(cjpfd, sizeof(PIXELFORMATDESCRIPTOR));
|
||||||
RtlCopyMemory(&pfdSafe, pfd, 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:
|
Exit:
|
||||||
DC_UnlockDc(pdc);
|
DC_UnlockDc(pdc);
|
||||||
|
@ -133,7 +131,7 @@ NtGdiSetPixelFormat(
|
||||||
|
|
||||||
if ( ipfd < 1 ||
|
if ( ipfd < 1 ||
|
||||||
ipfd > pdc->ipfdDevMax )
|
ipfd > pdc->ipfdDevMax )
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,10 @@ UserAddCallProcToClass(IN OUT PCLS Class,
|
||||||
IN PCALLPROCDATA CallProc);
|
IN PCALLPROCDATA CallProc);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
IntGetAtomFromStringOrAtom(IN PUNICODE_STRING ClassName,
|
NTAPI
|
||||||
OUT RTL_ATOM *Atom);
|
IntGetAtomFromStringOrAtom(
|
||||||
|
_In_ PUNICODE_STRING ClassName,
|
||||||
|
_Out_ RTL_ATOM *Atom);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
IntCheckProcessDesktopClasses(IN PDESKTOP Desktop,
|
IntCheckProcessDesktopClasses(IN PDESKTOP Desktop,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue