[WIN32SS] Use the DCFLAGS and DCTYPE flags defined in ntgdi/dc.h instead of the old ones in include/ntgdihdl.h

The names of these new flags match the documented ones at
https://reactos.org/wiki/Techwiki:Win32k/DC
https://books.google.hr/books?id=-O92IIF1Bj4C&pg=PA197&lpg=PA197
and the gdikdx debug extension.
This commit is contained in:
Hermès Bélusca-Maïto 2020-01-10 01:44:09 +01:00
parent 1c2b757a64
commit 5e93daa9ce
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
14 changed files with 54 additions and 76 deletions

View file

@ -61,7 +61,7 @@ NtGdiAlphaBlend(
DCDest = apObj[0];
DCSrc = apObj[1];
if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO)
if (DCDest->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO)
{
GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
GDIOBJ_vUnlockObject(&DCDest->BaseObject);
@ -239,7 +239,7 @@ NtGdiTransparentBlt(
DCDest = apObj[0];
DCSrc = apObj[1];
if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO)
if (DCDest->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO)
{
GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
GDIOBJ_vUnlockObject(&DCDest->BaseObject);
@ -401,7 +401,7 @@ NtGdiMaskBlt(
return FALSE;
}
if (DCDest->dctype == DC_TYPE_INFO)
if (DCDest->dctype == DCTYPE_INFO)
{
if(DCSrc) DC_UnlockDc(DCSrc);
DC_UnlockDc(DCDest);
@ -413,7 +413,7 @@ NtGdiMaskBlt(
if (UsesSource)
{
ASSERT(DCSrc);
if (DCSrc->dctype == DC_TYPE_INFO)
if (DCSrc->dctype == DCTYPE_INFO)
{
DC_UnlockDc(DCDest);
DC_UnlockDc(DCSrc);
@ -624,7 +624,7 @@ GreStretchBltMask(
DCSrc = apObj[1];
DCMask = apObj[2];
if (DCDest->dctype == DC_TYPE_INFO)
if (DCDest->dctype == DCTYPE_INFO)
{
if(DCSrc) GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject);
@ -635,7 +635,7 @@ GreStretchBltMask(
if (UsesSource)
{
if (DCSrc->dctype == DC_TYPE_INFO)
if (DCSrc->dctype == DCTYPE_INFO)
{
GDIOBJ_vUnlockObject(&DCDest->BaseObject);
GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
@ -941,7 +941,7 @@ IntGdiPolyPatBlt(
return FALSE;
}
if (pdc->dctype == DC_TYPE_INFO)
if (pdc->dctype == DCTYPE_INFO)
{
DC_UnlockDc(pdc);
/* Yes, Windows really returns TRUE in this case */

View file

@ -286,7 +286,7 @@ IntCreateCompatibleBitmap(
return NtGdiGetStockObject(DEFAULT_BITMAP);
}
if (Dc->dctype != DC_TYPE_MEMORY)
if (Dc->dctype != DCTYPE_MEMORY)
{
PSURFACE psurf;

View file

@ -17,7 +17,7 @@ IntGdiReleaseRaoRgn(PDC pDC)
{
INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr);
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
pDC->fs |= DC_FLAG_DIRTY_RAO;
pDC->fs |= DC_DIRTY_RAO;
Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; // Need to validate Vis.
}
@ -75,7 +75,7 @@ GdiSelectVisRgn(
return;
}
dc->fs |= DC_FLAG_DIRTY_RAO;
dc->fs |= DC_DIRTY_RAO;
ASSERT(dc->prgnVis != NULL);
ASSERT(prgn != NULL);
@ -234,7 +234,7 @@ IntGdiExtSelectClipRect(
{
Ret = IntSelectClipRgn( dc, NULL, RGN_COPY);
if (dc->fs & DC_FLAG_DIRTY_RAO)
if (dc->fs & DC_DIRTY_RAO)
CLIPPING_UpdateGCRegion(dc);
if (Ret) // Copy? Return Vis complexity.
@ -260,7 +260,7 @@ IntGdiExtSelectClipRect(
Ret = IntSelectClipRgn( dc, prgn, fnMode);
if (dc->fs & DC_FLAG_DIRTY_RAO)
if (dc->fs & DC_DIRTY_RAO)
CLIPPING_UpdateGCRegion(dc);
if (Ret) // In this case NtGdiExtSelectClipRgn tests pass.
@ -295,7 +295,7 @@ IntGdiExtSelectClipRgn(
{
DPRINT("IntGdiExtSelectClipRgn A %d\n",Ret);
// Update the Rao, it must be this way for now.
if (dc->fs & DC_FLAG_DIRTY_RAO)
if (dc->fs & DC_DIRTY_RAO)
CLIPPING_UpdateGCRegion(dc);
Ret = REGION_Complexity( dc->prgnRao ? dc->prgnRao : dc->prgnVis );
@ -376,7 +376,7 @@ GdiGetClipBox(
}
/* Update RAO region if necessary */
if (pdc->fs & DC_FLAG_DIRTY_RAO)
if (pdc->fs & DC_DIRTY_RAO)
CLIPPING_UpdateGCRegion(pdc);
/* Check if we have a RAO region (intersection of API and VIS region) */
@ -577,7 +577,7 @@ NtGdiOffsetClipRgn(
}
/* Mark the RAO region as dirty */
pdc->fs |= DC_FLAG_DIRTY_RAO;
pdc->fs |= DC_DIRTY_RAO;
}
else
{
@ -656,7 +656,7 @@ NtGdiRectVisible(
return FALSE;
}
if (dc->fs & DC_FLAG_DIRTY_RAO)
if (dc->fs & DC_DIRTY_RAO)
CLIPPING_UpdateGCRegion(dc);
prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis;
@ -765,7 +765,7 @@ CLIPPING_UpdateGCRegion(PDC pDC)
REGION_bOffsetRgn(pDC->prgnVis, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
pDC->fs &= ~DC_FLAG_DIRTY_RAO;
pDC->fs &= ~DC_DIRTY_RAO;
UpdateVisRgn(pDC);
return;
}
@ -823,7 +823,7 @@ CLIPPING_UpdateGCRegion(PDC pDC)
&pDC->prgnRao->rdh.rcBound,
sizeof(RECTL));
pDC->fs &= ~DC_FLAG_DIRTY_RAO;
pDC->fs &= ~DC_DIRTY_RAO;
UpdateVisRgn(pDC);
// pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build

View file

@ -14,7 +14,7 @@ enum _FONT_STATE
/* fl */
#define DC_FL_PAL_BACK 1
enum _DCFLAGS
typedef enum _DCFLAGS
{
DC_DISPLAY = 0x0001,
DC_DIRECT = 0x0002,
@ -34,13 +34,13 @@ enum _DCFLAGS
#if DBG
DC_PREPARED = 0x8000
#endif
};
} DCFLAGS;
typedef enum _DCTYPE
{
DCTYPE_DIRECT = 0,
DCTYPE_MEMORY = 1,
DCTYPE_INFO = 2,
DCTYPE_DIRECT = 0, /* Normal device context */
DCTYPE_MEMORY = 1, /* Memory device context */
DCTYPE_INFO = 2, /* Information context */
} DCTYPE;

View file

@ -546,7 +546,7 @@ DC_vPrepareDCsForBlit(
prcSecond = NULL;
}
if (pdcDest->fs & DC_FLAG_DIRTY_RAO)
if (pdcDest->fs & DC_DIRTY_RAO)
CLIPPING_UpdateGCRegion(pdcDest);
/* Lock and update first DC */
@ -905,7 +905,7 @@ IntGdiDeleteDC(HDC hDC, BOOL Force)
* For some reason, it's still a valid handle, pointing to some kernel data.
* Not sure if this is a bug, a feature, some cache stuff... Who knows?
* See NtGdiDeleteObjectApp test for details */
if (DCToDelete->fs & DC_FLAG_PERMANENT)
if (DCToDelete->fs & DC_PERMANANT)
{
DC_UnlockDc(DCToDelete);
if(UserReleaseDC(NULL, hDC, FALSE))
@ -972,16 +972,16 @@ MakeInfoDC(PDC pdc, BOOL bSet)
SIZEL sizl;
/* Can not be a display DC. */
if (pdc->fs & DC_FLAG_DISPLAY) return FALSE;
if (pdc->fs & DC_DISPLAY) return FALSE;
if (bSet)
{
if (pdc->fs & DC_FLAG_TEMPINFODC || pdc->dctype == DC_TYPE_DIRECT)
if (pdc->fs & DC_TEMPINFODC || pdc->dctype == DCTYPE_DIRECT)
return FALSE;
pSurface = pdc->dclevel.pSurface;
pdc->fs |= DC_FLAG_TEMPINFODC;
pdc->fs |= DC_TEMPINFODC;
pdc->pSurfInfo = pSurface;
pdc->dctype = DC_TYPE_INFO;
pdc->dctype = DCTYPE_INFO;
pdc->dclevel.pSurface = NULL;
PDEVOBJ_sizl(pdc->ppdev, &sizl);
@ -995,13 +995,13 @@ MakeInfoDC(PDC pdc, BOOL bSet)
}
else
{
if (!(pdc->fs & DC_FLAG_TEMPINFODC) || pdc->dctype != DC_TYPE_INFO)
if (!(pdc->fs & DC_TEMPINFODC) || pdc->dctype != DCTYPE_INFO)
return FALSE;
pSurface = pdc->pSurfInfo;
pdc->fs &= ~DC_FLAG_TEMPINFODC;
pdc->fs &= ~DC_TEMPINFODC;
pdc->dclevel.pSurface = pSurface;
pdc->dctype = DC_TYPE_DIRECT;
pdc->dctype = DCTYPE_DIRECT;
pdc->pSurfInfo = NULL;
if ( !pSurface ||
@ -1050,7 +1050,7 @@ IntGdiCreateDC(
pdmInit,
NULL,
CreateAsIC ? DCTYPE_INFO :
(Driver ? DC_TYPE_DIRECT : DC_TYPE_DIRECT),
(Driver ? DCTYPE_DIRECT : DCTYPE_DIRECT),
TRUE,
NULL,
NULL,
@ -1065,10 +1065,10 @@ IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC)
HDC hDC;
UNIMPLEMENTED;
if (DcType == DC_TYPE_MEMORY)
if (DcType == DCTYPE_MEMORY)
hDC = NtGdiCreateCompatibleDC(NULL); // OH~ Yuck! I think I taste vomit in my mouth!
else
hDC = IntGdiCreateDC(NULL, NULL, NULL, NULL, (DcType == DC_TYPE_INFO));
hDC = IntGdiCreateDC(NULL, NULL, NULL, NULL, (DcType == DCTYPE_INFO));
return hDC;
}

View file

@ -361,7 +361,7 @@ NtGdiSelectBitmap(
}
/* Must be a memory dc to select a bitmap */
if (pdc->dctype != DC_TYPE_MEMORY)
if (pdc->dctype != DCTYPE_MEMORY)
{
DC_UnlockDc(pdc);
return NULL;
@ -462,7 +462,7 @@ NtGdiSelectBitmap(
/* Mark the DC brushes and the RAO region invalid */
pdc->pdcattr->ulDirty_ |= DIRTY_FILL | DIRTY_LINE;
pdc->fs |= DC_FLAG_DIRTY_RAO;
pdc->fs |= DC_DIRTY_RAO;
/* Update the system region */
REGION_SetRectRgn(pdc->prgnVis,
@ -733,7 +733,7 @@ NtGdiGetRandomRgn(
break;
case APIRGN:
if (pdc->fs & DC_FLAG_DIRTY_RAO)
if (pdc->fs & DC_DIRTY_RAO)
CLIPPING_UpdateGCRegion(pdc);
if (pdc->prgnAPI)
{

View file

@ -63,7 +63,7 @@ DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To)
pdcDst->dclevel.prgnMeta = IntSysCreateRectpRgn(0, 0, 0, 0);
IntGdiCombineRgn(pdcDst->dclevel.prgnMeta, pdcSrc->dclevel.prgnMeta, NULL, RGN_COPY);
}
pdcDst->fs |= DC_FLAG_DIRTY_RAO;
pdcDst->fs |= DC_DIRTY_RAO;
}
}
@ -109,7 +109,7 @@ IntGdiCleanDC(HDC hDC)
REGION_Delete(dc->prgnAPI);
dc->prgnRao = dc->prgnAPI = NULL;
dc->fs |= DC_FLAG_DIRTY_RAO;
dc->fs |= DC_DIRTY_RAO;
DC_UnlockDc(dc);

View file

@ -328,7 +328,7 @@ DCU_SetDcUndeletable(HDC hDC)
return;
}
dc->fs |= DC_FLAG_PERMANENT;
dc->fs |= DC_PERMANANT;
DC_UnlockDc(dc);
return;
}
@ -430,7 +430,7 @@ IntGdiSetHookFlags(HDC hDC, WORD Flags)
return 0;
}
wRet = dc->fs & DC_FLAG_DIRTY_RAO; // FIXME: Wrong flag!
wRet = dc->fs & DC_DIRTY_RAO; // FIXME: Wrong flag!
/* Info in "Undocumented Windows" is slightly confusing. */
DPRINT("DC %p, Flags %04x\n", hDC, Flags);
@ -438,11 +438,11 @@ IntGdiSetHookFlags(HDC hDC, WORD Flags)
if (Flags & DCHF_INVALIDATEVISRGN)
{
/* hVisRgn has to be updated */
dc->fs |= DC_FLAG_DIRTY_RAO;
dc->fs |= DC_DIRTY_RAO;
}
else if (Flags & DCHF_VALIDATEVISRGN || 0 == Flags)
{
//dc->fs &= ~DC_FLAG_DIRTY_RAO;
//dc->fs &= ~DC_DIRTY_RAO;
}
DC_UnlockDc(dc);
@ -729,7 +729,7 @@ NtGdiGetBoundsRect(
else
{
RECTL rcRgn;
if (pdc->fs & DC_FLAG_DIRTY_RAO) CLIPPING_UpdateGCRegion(pdc);
if (pdc->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(pdc);
if(!REGION_GetRgnBox(pdc->prgnRao, &rcRgn))
{
REGION_GetRgnBox(pdc->prgnVis, &rcRgn);

View file

@ -529,7 +529,7 @@ NtGdiSetDIBitsToDeviceInternal(
goto Exit;
}
if (pDC->dctype == DC_TYPE_INFO)
if (pDC->dctype == DCTYPE_INFO)
{
ret = 0;
goto Exit;
@ -714,7 +714,7 @@ GreGetDIBitsInternal(
return 0;
pDC = DC_LockDc(hDC);
if (pDC == NULL || pDC->dctype == DC_TYPE_INFO)
if (pDC == NULL || pDC->dctype == DCTYPE_INFO)
{
ScanLines = 0;
goto done;

View file

@ -770,7 +770,7 @@ IntGdiRealizePalette(HDC hDC)
ASSERT(ppalDC->flFlags & PAL_INDEXED);
DPRINT1("RealizePalette unimplemented for %s\n",
(pdc->dctype == DC_TYPE_MEMORY ? "memory managed DCs" : "device DCs"));
(pdc->dctype == DCTYPE_MEMORY ? "memory managed DCs" : "device DCs"));
cleanup:
DC_UnlockDc(pdc);

View file

@ -119,28 +119,6 @@
#define GDI_OBJ_HMGR_RESTRICTED 0x80000022 /* Restricted? */
/* DC OBJ Types */
#define DC_TYPE_DIRECT 0 /* normal device context */
#define DC_TYPE_MEMORY 1 /* memory device context */
#define DC_TYPE_INFO 2 /* information context */
/* DC OBJ Flags */
#define DC_FLAG_DISPLAY 0x0001
#define DC_FLAG_DIRECT 0x0002
#define DC_FLAG_CANCELLED 0x0004
#define DC_FLAG_PERMANENT 0x0008
#define DC_FLAG_DIRTY_RAO 0x0010
#define DC_FLAG_ACCUM_WMGR 0x0020
#define DC_FLAG_ACCUM_APP 0x0040
#define DC_FLAG_RESET 0x0080
#define DC_FLAG_SYNCHRONIZEACCESS 0x0100
#define DC_FLAG_EPSPRINTINGESCAPE 0x0200
#define DC_FLAG_TEMPINFODC 0x0400
#define DC_FLAG_FULLSCREEN 0x0800
#define DC_FLAG_IN_CLONEPDEV 0x1000
#define DC_FLAG_REDIRECTION 0x2000
#define DC_FLAG_SHAREACCESS 0x4000
/* DC_ATTR Dirty Flags */
#define DIRTY_FILL 0x00000001
#define DIRTY_LINE 0x00000002

View file

@ -461,7 +461,7 @@ DxEngGetDCState(HDC hDC,
switch (type)
{
case 1:
retVal = (DWORD_PTR) pDC->fs & DC_FLAG_FULLSCREEN;
retVal = (DWORD_PTR) pDC->fs & DC_FULLSCREEN;
break;
case 2:
/* Return the complexity of the visible region. */
@ -656,7 +656,7 @@ HDC
APIENTRY
DxEngCreateMemoryDC(HDEV hDev)
{
return IntGdiCreateDisplayDC(hDev, DC_TYPE_MEMORY, FALSE);
return IntGdiCreateDisplayDC(hDev, DCTYPE_MEMORY, FALSE);
}
/************************************************************************/
@ -748,9 +748,9 @@ DxEngSetDCState(HDC hDC, DWORD SetType, DWORD Set)
if (SetType == 1)
{
if ( Set )
pDC->fs |= DC_FLAG_FULLSCREEN;
pDC->fs |= DC_FULLSCREEN;
else
pDC->fs &= ~DC_FLAG_FULLSCREEN;
pDC->fs &= ~DC_FULLSCREEN;
Ret = TRUE;
}
DC_UnlockDc(pDC);

View file

@ -1550,7 +1550,7 @@ UserGetDesktopDC(ULONG DcType, BOOL bAltDc, BOOL ValidatehWnd)
/* This can be called from GDI/DX, so acquire the USER lock */
UserEnterExclusive();
if (DcType == DC_TYPE_DIRECT)
if (DcType == DCTYPE_DIRECT)
{
DesktopObject = UserGetDesktopWindow();
DesktopHDC = (HDC)UserGetWindowDC(DesktopObject);

View file

@ -874,7 +874,7 @@ DceResetActiveDCEs(PWND Window)
if (NULL != dc->dclevel.prgnClip)
{
REGION_bOffsetRgn(dc->dclevel.prgnClip, DeltaX, DeltaY);
dc->fs |= DC_FLAG_DIRTY_RAO;
dc->fs |= DC_DIRTY_RAO;
}
if (NULL != pDCE->hrgnClip)
{