gdi32: Implement the polygon entry points in the path driver.
This commit is contained in:
parent
ac00dfc984
commit
d4889bef47
|
@ -329,9 +329,7 @@ extern BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
|
||||||
LPCWSTR str, UINT count, const INT *dx) DECLSPEC_HIDDEN;
|
LPCWSTR str, UINT count, const INT *dx) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PATH_PolylineTo(DC *dc, const POINT *pt, DWORD cbCount) DECLSPEC_HIDDEN;
|
extern BOOL PATH_PolylineTo(DC *dc, const POINT *pt, DWORD cbCount) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PATH_Polyline(DC *dc, const POINT *pt, DWORD cbCount) DECLSPEC_HIDDEN;
|
extern BOOL PATH_Polyline(DC *dc, const POINT *pt, DWORD cbCount) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PATH_Polygon(DC *dc, const POINT *pt, DWORD cbCount) DECLSPEC_HIDDEN;
|
|
||||||
extern BOOL PATH_PolyPolyline(DC *dc, const POINT *pt, const DWORD *counts, DWORD polylines) DECLSPEC_HIDDEN;
|
extern BOOL PATH_PolyPolyline(DC *dc, const POINT *pt, const DWORD *counts, DWORD polylines) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PATH_PolyPolygon(DC *dc, const POINT *pt, const INT *counts, UINT polygons) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
/* painting.c */
|
/* painting.c */
|
||||||
extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut ) DECLSPEC_HIDDEN;
|
extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut ) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -776,14 +776,10 @@ BOOL WINAPI Polygon( HDC hdc, const POINT* pt, INT count )
|
||||||
DC * dc = get_dc_ptr( hdc );
|
DC * dc = get_dc_ptr( hdc );
|
||||||
|
|
||||||
if (dc)
|
if (dc)
|
||||||
{
|
|
||||||
update_dc( dc );
|
|
||||||
if (PATH_IsPathOpen(dc->path)) ret = PATH_Polygon(dc, pt, count);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPolygon );
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPolygon );
|
||||||
|
update_dc( dc );
|
||||||
ret = physdev->funcs->pPolygon( physdev, pt, count );
|
ret = physdev->funcs->pPolygon( physdev, pt, count );
|
||||||
}
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -800,14 +796,10 @@ BOOL WINAPI PolyPolygon( HDC hdc, const POINT* pt, const INT* counts,
|
||||||
DC * dc = get_dc_ptr( hdc );
|
DC * dc = get_dc_ptr( hdc );
|
||||||
|
|
||||||
if (dc)
|
if (dc)
|
||||||
{
|
|
||||||
update_dc( dc );
|
|
||||||
if (PATH_IsPathOpen(dc->path)) ret = PATH_PolyPolygon(dc, pt, counts, polygons);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPolyPolygon );
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pPolyPolygon );
|
||||||
|
update_dc( dc );
|
||||||
ret = physdev->funcs->pPolyPolygon( physdev, pt, counts, polygons );
|
ret = physdev->funcs->pPolyPolygon( physdev, pt, counts, polygons );
|
||||||
}
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -1373,49 +1373,45 @@ BOOL PATH_PolylineTo(DC *dc, const POINT *pts, DWORD cbPoints)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL PATH_Polygon(DC *dc, const POINT *pts, DWORD cbPoints)
|
/*************************************************************
|
||||||
|
* pathdrv_Polygon
|
||||||
|
*/
|
||||||
|
static BOOL pathdrv_Polygon( PHYSDEV dev, const POINT *pts, INT cbPoints )
|
||||||
{
|
{
|
||||||
GdiPath *pPath = &dc->path;
|
struct path_physdev *physdev = get_path_physdev( dev );
|
||||||
POINT pt;
|
POINT pt;
|
||||||
UINT i;
|
INT i;
|
||||||
|
|
||||||
/* Check that path is open */
|
|
||||||
if(pPath->state!=PATH_Open)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
for(i = 0; i < cbPoints; i++) {
|
for(i = 0; i < cbPoints; i++) {
|
||||||
pt = pts[i];
|
pt = pts[i];
|
||||||
if(!LPtoDP(dc->hSelf, &pt, 1))
|
LPtoDP( dev->hdc, &pt, 1 );
|
||||||
return FALSE;
|
PATH_AddEntry(physdev->path, &pt, (i == 0) ? PT_MOVETO :
|
||||||
PATH_AddEntry(pPath, &pt, (i == 0) ? PT_MOVETO :
|
|
||||||
((i == cbPoints-1) ? PT_LINETO | PT_CLOSEFIGURE :
|
((i == cbPoints-1) ? PT_LINETO | PT_CLOSEFIGURE :
|
||||||
PT_LINETO));
|
PT_LINETO));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL PATH_PolyPolygon( DC *dc, const POINT* pts, const INT* counts,
|
|
||||||
UINT polygons )
|
/*************************************************************
|
||||||
|
* pathdrv_PolyPolygon
|
||||||
|
*/
|
||||||
|
static BOOL pathdrv_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts, UINT polygons )
|
||||||
{
|
{
|
||||||
GdiPath *pPath = &dc->path;
|
struct path_physdev *physdev = get_path_physdev( dev );
|
||||||
POINT pt, startpt;
|
POINT pt, startpt;
|
||||||
UINT poly, i;
|
UINT poly, i;
|
||||||
INT point;
|
INT point;
|
||||||
|
|
||||||
/* Check that path is open */
|
|
||||||
if(pPath->state!=PATH_Open)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
for(i = 0, poly = 0; poly < polygons; poly++) {
|
for(i = 0, poly = 0; poly < polygons; poly++) {
|
||||||
for(point = 0; point < counts[poly]; point++, i++) {
|
for(point = 0; point < counts[poly]; point++, i++) {
|
||||||
pt = pts[i];
|
pt = pts[i];
|
||||||
if(!LPtoDP(dc->hSelf, &pt, 1))
|
LPtoDP( dev->hdc, &pt, 1 );
|
||||||
return FALSE;
|
|
||||||
if(point == 0) startpt = pt;
|
if(point == 0) startpt = pt;
|
||||||
PATH_AddEntry(pPath, &pt, (point == 0) ? PT_MOVETO : PT_LINETO);
|
PATH_AddEntry(physdev->path, &pt, (point == 0) ? PT_MOVETO : PT_LINETO);
|
||||||
}
|
}
|
||||||
/* win98 adds an extra line to close the figure for some reason */
|
/* win98 adds an extra line to close the figure for some reason */
|
||||||
PATH_AddEntry(pPath, &startpt, PT_LINETO | PT_CLOSEFIGURE);
|
PATH_AddEntry(physdev->path, &startpt, PT_LINETO | PT_CLOSEFIGURE);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -2362,9 +2358,9 @@ const struct gdi_dc_funcs path_driver =
|
||||||
pathdrv_PolyBezier, /* pPolyBezier */
|
pathdrv_PolyBezier, /* pPolyBezier */
|
||||||
pathdrv_PolyBezierTo, /* pPolyBezierTo */
|
pathdrv_PolyBezierTo, /* pPolyBezierTo */
|
||||||
pathdrv_PolyDraw, /* pPolyDraw */
|
pathdrv_PolyDraw, /* pPolyDraw */
|
||||||
NULL, /* pPolyPolygon */
|
pathdrv_PolyPolygon, /* pPolyPolygon */
|
||||||
NULL, /* pPolyPolyline */
|
NULL, /* pPolyPolyline */
|
||||||
NULL, /* pPolygon */
|
pathdrv_Polygon, /* pPolygon */
|
||||||
NULL, /* pPolyline */
|
NULL, /* pPolyline */
|
||||||
NULL, /* pPolylineTo */
|
NULL, /* pPolylineTo */
|
||||||
NULL, /* pPutImage */
|
NULL, /* pPutImage */
|
||||||
|
|
Loading…
Reference in New Issue