gdiplus: Add software implementation of GdipFillPath.

This commit is contained in:
Vincent Povirk 2011-03-10 16:16:26 -06:00 committed by Alexandre Julliard
parent 833316f91d
commit b5c2015999
1 changed files with 52 additions and 14 deletions

View File

@ -3402,24 +3402,13 @@ GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x
return GdipFillEllipse(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
}
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
static GpStatus GDI32_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
{
INT save_state;
GpStatus retval;
TRACE("(%p, %p, %p)\n", graphics, brush, path);
if(!brush || !graphics || !path)
return InvalidParameter;
if(graphics->busy)
return ObjectBusy;
if(!graphics->hdc)
{
FIXME("graphics object has no HDC\n");
return Ok;
}
if(!graphics->hdc || !brush_can_fill_path(brush))
return NotImplemented;
save_state = SaveDC(graphics->hdc);
EndPath(graphics->hdc);
@ -3444,6 +3433,55 @@ end:
return retval;
}
static GpStatus SOFTWARE_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
{
GpStatus stat;
GpRegion *rgn;
if (!brush_can_fill_pixels(brush))
return NotImplemented;
/* FIXME: This could probably be done more efficiently without regions. */
stat = GdipCreateRegionPath(path, &rgn);
if (stat == Ok)
{
stat = GdipFillRegion(graphics, brush, rgn);
GdipDeleteRegion(rgn);
}
return stat;
}
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
{
GpStatus stat = NotImplemented;
TRACE("(%p, %p, %p)\n", graphics, brush, path);
if(!brush || !graphics || !path)
return InvalidParameter;
if(graphics->busy)
return ObjectBusy;
if (!graphics->image)
stat = GDI32_GdipFillPath(graphics, brush, path);
if (stat == NotImplemented)
stat = SOFTWARE_GdipFillPath(graphics, brush, path);
if (stat == NotImplemented)
{
FIXME("Not implemented for brushtype %i\n", brush->bt);
stat = Ok;
}
return stat;
}
GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
{