mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 04:26:00 +00:00
[NTGDI] Support the wide pen (#4137)
- Extend PATH_WidenPath function as PATH_WidenPathEx with the path argument. - Use PATH_WidenPathEx and PATH_FillPathEx functions to implement wide pen drawing in PATH_StrokePath function. - Add the code to IntGdiLineTo, IntRectangle, IntGdiPolygon, and IntGdiPolyline in order to stroke the path when the effective wide pen. FIXME: Boundary rectangle. CORE-2527, CORE-8366
This commit is contained in:
parent
ff89651ed0
commit
6358c4ac9f
5 changed files with 258 additions and 85 deletions
|
@ -1600,17 +1600,35 @@ PATH_StrokePath(
|
|||
PPATH pPath)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
INT i = 0;
|
||||
INT nLinePts, nAlloc;
|
||||
INT nLinePts, nAlloc, jOldFillMode, i = 0;
|
||||
POINT *pLinePts = NULL;
|
||||
POINT ptViewportOrg, ptWindowOrg;
|
||||
SIZE szViewportExt, szWindowExt;
|
||||
DWORD mapMode, graphicsMode;
|
||||
XFORM xform;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
PBRUSH pbrLine;
|
||||
PPATH pNewPath;
|
||||
|
||||
TRACE("Enter %s\n", __FUNCTION__);
|
||||
|
||||
pbrLine = dc->dclevel.pbrLine;
|
||||
if (IntIsEffectiveWidePen(pbrLine))
|
||||
{
|
||||
pNewPath = PATH_WidenPathEx(dc, pPath);
|
||||
if (pNewPath)
|
||||
{
|
||||
/* Fill the path with the WINDING fill mode */
|
||||
jOldFillMode = pdcattr->jFillMode;
|
||||
pdcattr->jFillMode = WINDING;
|
||||
PATH_FillPathEx(dc, pNewPath, pbrLine);
|
||||
pdcattr->jFillMode = jOldFillMode;
|
||||
|
||||
PATH_Delete(pNewPath->BaseObject.hHmgr);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the mapping mode info */
|
||||
mapMode = pdcattr->iMapMode;
|
||||
|
||||
|
@ -2100,12 +2118,7 @@ PPATH
|
|||
FASTCALL
|
||||
PATH_WidenPath(DC *dc)
|
||||
{
|
||||
INT size;
|
||||
UINT penWidth, penStyle;
|
||||
DWORD obj_type;
|
||||
PPATH pPath, pNewPath;
|
||||
LPEXTLOGPEN elp;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
pPath = PATH_LockPath(dc->dclevel.hPath);
|
||||
if (!pPath)
|
||||
|
@ -2114,10 +2127,24 @@ PATH_WidenPath(DC *dc)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
pNewPath = PATH_WidenPathEx(dc, pPath);
|
||||
PATH_UnlockPath(pPath);
|
||||
return pNewPath;
|
||||
}
|
||||
|
||||
PPATH
|
||||
FASTCALL
|
||||
PATH_WidenPathEx(DC *dc, PPATH pPath)
|
||||
{
|
||||
INT size;
|
||||
UINT penWidth, penStyle;
|
||||
DWORD obj_type;
|
||||
LPEXTLOGPEN elp;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
if (pPath->state != PATH_Closed)
|
||||
{
|
||||
TRACE("PWP 1\n");
|
||||
PATH_UnlockPath(pPath);
|
||||
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2126,7 +2153,6 @@ PATH_WidenPath(DC *dc)
|
|||
if (!size)
|
||||
{
|
||||
TRACE("PWP 2\n");
|
||||
PATH_UnlockPath(pPath);
|
||||
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2135,7 +2161,6 @@ PATH_WidenPath(DC *dc)
|
|||
if (elp == NULL)
|
||||
{
|
||||
TRACE("PWP 3\n");
|
||||
PATH_UnlockPath(pPath);
|
||||
EngSetLastError(ERROR_OUTOFMEMORY);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2156,7 +2181,6 @@ PATH_WidenPath(DC *dc)
|
|||
TRACE("PWP 4\n");
|
||||
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
|
||||
ExFreePoolWithTag(elp, TAG_PATH);
|
||||
PATH_UnlockPath(pPath);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2168,14 +2192,11 @@ PATH_WidenPath(DC *dc)
|
|||
(PS_TYPE_MASK & penStyle) == PS_COSMETIC)
|
||||
{
|
||||
TRACE("PWP 5\n");
|
||||
PATH_UnlockPath(pPath);
|
||||
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pNewPath = IntGdiWidenPath(pPath, penWidth, penStyle, dc->dclevel.laPath.eMiterLimit);
|
||||
PATH_UnlockPath(pPath);
|
||||
return pNewPath;
|
||||
return IntGdiWidenPath(pPath, penWidth, penStyle, dc->dclevel.laPath.eMiterLimit);
|
||||
}
|
||||
|
||||
static inline INT int_from_fixed(FIXED f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue