Commit 6920cf68 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Reimplement GdipDrawPolygon based on GdipDrawPath.

parent 6c876de7
......@@ -6164,8 +6164,8 @@ GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics *graphics, GpRegion *region,
GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPointF *points,
INT count)
{
INT save_state;
POINT *pti;
GpStatus status;
GpPath* path;
TRACE("(%p, %p, %d)\n", graphics, points, count);
......@@ -6175,24 +6175,16 @@ GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST Gp
if(graphics->busy)
return ObjectBusy;
if (!graphics->hdc)
{
FIXME("graphics object has no HDC\n");
return Ok;
}
pti = heap_alloc_zero(sizeof(POINT) * count);
save_state = prepare_dc(graphics, pen);
SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH));
status = GdipCreatePath(FillModeAlternate, &path);
if (status != Ok) return status;
transform_and_round_points(graphics, pti, (GpPointF*)points, count);
Polygon(graphics->hdc, pti, count);
status = GdipAddPathPolygon(path, points, count);
if (status == Ok)
status = GdipDrawPath(graphics, pen, path);
restore_dc(graphics, save_state);
heap_free(pti);
GdipDeletePath(path);
return Ok;
return status;
}
GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPoint *points,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment