Implement NtGdiPolyDraw (based on wine).

svn path=/trunk/; revision=25249
This commit is contained in:
Saveliy Tretiakov 2006-12-30 20:46:05 +00:00
parent 0651dba483
commit 34444545a2
4 changed files with 72 additions and 25 deletions

View file

@ -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

View file

@ -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
*/

View file

@ -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 */

View file

@ -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