gdiplus/metafile: Implement FillPie() recording.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Esme Povirk <esme@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2a7940c97d
commit
9b04f1c660
|
@ -113,6 +113,8 @@ extern void METAFILE_Free(GpMetafile *metafile) DECLSPEC_HIDDEN;
|
|||
extern GpStatus METAFILE_DrawEllipse(GpMetafile *metafile, GpPen *pen, GpRectF *rect) DECLSPEC_HIDDEN;
|
||||
extern GpStatus METAFILE_FillEllipse(GpMetafile *metafile, GpBrush *brush, GpRectF *rect) DECLSPEC_HIDDEN;
|
||||
extern GpStatus METAFILE_DrawRectangles(GpMetafile *metafile, GpPen *pen, const GpRectF *rects, INT count) DECLSPEC_HIDDEN;
|
||||
extern GpStatus METAFILE_FillPie(GpMetafile *metafile, GpBrush *brush, const GpRectF *rect,
|
||||
REAL startAngle, REAL sweepAngle) DECLSPEC_HIDDEN;
|
||||
|
||||
extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1,
|
||||
REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -4402,6 +4402,7 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
|
|||
{
|
||||
GpStatus stat;
|
||||
GpPath *path;
|
||||
GpRectF rect;
|
||||
|
||||
TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
|
||||
graphics, brush, x, y, width, height, startAngle, sweepAngle);
|
||||
|
@ -4412,6 +4413,15 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
|
|||
if(graphics->busy)
|
||||
return ObjectBusy;
|
||||
|
||||
if (is_metafile_graphics(graphics))
|
||||
{
|
||||
rect.X = x;
|
||||
rect.Y = y;
|
||||
rect.Width = width;
|
||||
rect.Height = height;
|
||||
return METAFILE_FillPie((GpMetafile *)graphics->image, brush, &rect, startAngle, sweepAngle);
|
||||
}
|
||||
|
||||
stat = GdipCreatePath(FillModeAlternate, &path);
|
||||
|
||||
if (stat == Ok)
|
||||
|
|
|
@ -4896,6 +4896,59 @@ GpStatus METAFILE_FillEllipse(GpMetafile *metafile, GpBrush *brush, GpRectF *rec
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus METAFILE_FillPie(GpMetafile *metafile, GpBrush *brush, const GpRectF *rect,
|
||||
REAL startAngle, REAL sweepAngle)
|
||||
{
|
||||
BOOL is_int_rect, inline_color;
|
||||
EmfPlusFillPie *record;
|
||||
DWORD brush_id = -1;
|
||||
GpStatus stat;
|
||||
|
||||
if (metafile->metafile_type == MetafileTypeEmf)
|
||||
{
|
||||
FIXME("stub!\n");
|
||||
return NotImplemented;
|
||||
}
|
||||
|
||||
inline_color = brush->bt == BrushTypeSolidColor;
|
||||
if (!inline_color)
|
||||
{
|
||||
stat = METAFILE_AddBrushObject(metafile, brush, &brush_id);
|
||||
if (stat != Ok) return stat;
|
||||
}
|
||||
|
||||
is_int_rect = is_integer_rect(rect);
|
||||
|
||||
stat = METAFILE_AllocateRecord(metafile, FIELD_OFFSET(EmfPlusFillPie, RectData) +
|
||||
is_int_rect ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF), (void **)&record);
|
||||
if (stat != Ok) return stat;
|
||||
record->Header.Type = EmfPlusRecordTypeFillPie;
|
||||
if (inline_color)
|
||||
{
|
||||
record->Header.Flags = 0x8000;
|
||||
record->BrushId = ((GpSolidFill *)brush)->color;
|
||||
}
|
||||
else
|
||||
record->BrushId = brush_id;
|
||||
|
||||
record->StartAngle = startAngle;
|
||||
record->SweepAngle = sweepAngle;
|
||||
|
||||
if (is_int_rect)
|
||||
{
|
||||
record->Header.Flags |= 0x4000;
|
||||
record->RectData.rect.X = (SHORT)rect->X;
|
||||
record->RectData.rect.Y = (SHORT)rect->Y;
|
||||
record->RectData.rect.Width = (SHORT)rect->Width;
|
||||
record->RectData.rect.Height = (SHORT)rect->Height;
|
||||
}
|
||||
else
|
||||
memcpy(&record->RectData.rectF, rect, sizeof(*rect));
|
||||
|
||||
METAFILE_WriteRecords(metafile);
|
||||
return Ok;
|
||||
}
|
||||
|
||||
static GpStatus METAFILE_AddFontObject(GpMetafile *metafile, GDIPCONST GpFont *font, DWORD *id)
|
||||
{
|
||||
EmfPlusObject *object_record;
|
||||
|
|
Loading…
Reference in New Issue