mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 22:47:28 +00:00
Implement NtGdiPolyDraw (based on wine).
svn path=/trunk/; revision=25249
This commit is contained in:
parent
0651dba483
commit
34444545a2
|
@ -494,7 +494,7 @@ PlayMetaFileRecord@16
|
|||
PlgBlt@40=NtGdiPlgBlt@40
|
||||
PolyBezier@12=NtGdiPolyBezier@12
|
||||
PolyBezierTo@12=NtGdiPolyBezierTo@12
|
||||
PolyDraw@16
|
||||
PolyDraw@16=NtGdiPolyDraw@16
|
||||
PolyPolygon@16=NtGdiPolyPolygon@16
|
||||
PolyPolyline@16=NtGdiPolyPolyline@16
|
||||
PolyTextOutA@12
|
||||
|
|
|
@ -784,24 +784,6 @@ SetAbortProc(
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
PolyDraw(
|
||||
HDC hdc,
|
||||
CONST POINT *a1,
|
||||
CONST BYTE *a2,
|
||||
int a3
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
|
|
@ -22,4 +22,6 @@ BOOL FASTCALL PATH_Rectangle (PDC dc, INT x1, INT y1, INT x2, INT y2);
|
|||
BOOL FASTCALL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height);
|
||||
BOOL FASTCALL PATH_PathToRegion (GdiPath *pPath, INT nPolyFillMode, HRGN *pHrgn);
|
||||
|
||||
VOID FASTCALL IntGdiCloseFigure(PDC pDc);
|
||||
|
||||
#endif /* _WIN32K_PATH_H */
|
||||
|
|
|
@ -149,7 +149,6 @@ IntGdiPolyBezier(DC *dc,
|
|||
Pts = GDI_Bezier ( pt, Count, &nOut );
|
||||
if ( Pts )
|
||||
{
|
||||
DbgPrint("Pts = %p, no = %d\n", Pts, nOut);
|
||||
ret = IntGdiPolyline(dc, Pts, nOut);
|
||||
ExFreePool(Pts);
|
||||
}
|
||||
|
@ -729,12 +728,76 @@ BOOL
|
|||
APIENTRY
|
||||
NtGdiPolyDraw(
|
||||
IN HDC hdc,
|
||||
IN LPPOINT ppt,
|
||||
IN LPBYTE pjAttr,
|
||||
IN ULONG cpt)
|
||||
IN LPPOINT lppt,
|
||||
IN LPBYTE lpbTypes,
|
||||
IN ULONG cCount)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
PDC dc;
|
||||
BOOL result = FALSE;
|
||||
POINT lastmove;
|
||||
unsigned int i;
|
||||
|
||||
dc = DC_LockDc(hdc);
|
||||
if(!dc) return FALSE;
|
||||
|
||||
_SEH_TRY
|
||||
{
|
||||
ProbeArrayForRead(lppt, sizeof(POINT), cCount, sizeof(LONG));
|
||||
ProbeArrayForRead(lpbTypes, sizeof(BYTE), cCount, sizeof(BYTE));
|
||||
|
||||
/* check for each bezierto if there are two more points */
|
||||
for( i = 0; i < cCount; i++ )
|
||||
if( lpbTypes[i] != PT_MOVETO &&
|
||||
lpbTypes[i] & PT_BEZIERTO )
|
||||
{
|
||||
if( cCount < i+3 ) _SEH_LEAVE;
|
||||
else i += 2;
|
||||
}
|
||||
|
||||
/* if no moveto occurs, we will close the figure here */
|
||||
lastmove.x = dc->w.CursPosX;
|
||||
lastmove.y = dc->w.CursPosY;
|
||||
|
||||
/* now let's draw */
|
||||
for( i = 0; i < cCount; i++ )
|
||||
{
|
||||
if( lpbTypes[i] == PT_MOVETO )
|
||||
{
|
||||
IntGdiMoveToEx( dc, lppt[i].x, lppt[i].y, NULL );
|
||||
lastmove.x = dc->w.CursPosX;
|
||||
lastmove.y = dc->w.CursPosY;
|
||||
}
|
||||
else if( lpbTypes[i] & PT_LINETO )
|
||||
IntGdiLineTo( dc, lppt[i].x, lppt[i].y );
|
||||
else if( lpbTypes[i] & PT_BEZIERTO )
|
||||
{
|
||||
POINT pts[4];
|
||||
pts[0].x = dc->w.CursPosX;
|
||||
pts[0].y = dc->w.CursPosY;
|
||||
RtlCopyMemory(pts + 1, lppt, sizeof(POINT) * 3);
|
||||
IntGdiPolyBezier(dc, pts, 4);
|
||||
i += 2;
|
||||
}
|
||||
else _SEH_LEAVE;
|
||||
|
||||
if( lpbTypes[i] & PT_CLOSEFIGURE )
|
||||
{
|
||||
if( PATH_IsPathOpen( dc->w.path ) ) IntGdiCloseFigure( dc );
|
||||
else IntGdiLineTo( dc, lastmove.x, lastmove.y );
|
||||
}
|
||||
}
|
||||
|
||||
result = TRUE;
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
SetLastNtError(_SEH_GetExceptionCode());
|
||||
}
|
||||
_SEH_END;
|
||||
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
|
Loading…
Reference in a new issue