gdiplus: Reimplement GdipDrawPolygon based on GdipDrawPath.

Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Vincent Povirk 2016-10-19 10:03:05 -05:00 committed by Alexandre Julliard
parent 6c876de7d0
commit 6920cf68e6
1 changed files with 9 additions and 17 deletions

View File

@ -6164,8 +6164,8 @@ GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics *graphics, GpRegion *region,
GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPointF *points, GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPointF *points,
INT count) INT count)
{ {
INT save_state; GpStatus status;
POINT *pti; GpPath* path;
TRACE("(%p, %p, %d)\n", graphics, points, count); TRACE("(%p, %p, %d)\n", graphics, points, count);
@ -6175,24 +6175,16 @@ GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST Gp
if(graphics->busy) if(graphics->busy)
return ObjectBusy; return ObjectBusy;
if (!graphics->hdc) status = GdipCreatePath(FillModeAlternate, &path);
{ if (status != Ok) return status;
FIXME("graphics object has no HDC\n");
return Ok;
}
pti = heap_alloc_zero(sizeof(POINT) * count); status = GdipAddPathPolygon(path, points, count);
if (status == Ok)
status = GdipDrawPath(graphics, pen, path);
save_state = prepare_dc(graphics, pen); GdipDeletePath(path);
SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH));
transform_and_round_points(graphics, pti, (GpPointF*)points, count); return status;
Polygon(graphics->hdc, pti, count);
restore_dc(graphics, save_state);
heap_free(pti);
return Ok;
} }
GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPoint *points, GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPoint *points,