Commit c17cd0fc authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus/metafile: Implement DrawArc() recording.

parent beefe76c
......@@ -115,6 +115,8 @@ extern GpStatus METAFILE_FillEllipse(GpMetafile *metafile, GpBrush *brush, GpRec
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 GpStatus METAFILE_DrawArc(GpMetafile *metafile, GpPen *pen, 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;
......
......@@ -2595,6 +2595,7 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
{
GpStatus status;
GpPath *path;
GpRectF rect;
TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y,
width, height, startAngle, sweepAngle);
......@@ -2605,6 +2606,12 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
if(graphics->busy)
return ObjectBusy;
if (is_metafile_graphics(graphics))
{
set_rect(&rect, x, y, width, height);
return METAFILE_DrawArc((GpMetafile *)graphics->image, pen, &rect, startAngle, sweepAngle);
}
status = GdipCreatePath(FillModeAlternate, &path);
if (status != Ok) return status;
......
......@@ -5205,3 +5205,49 @@ GpStatus METAFILE_DrawRectangles(GpMetafile *metafile, GpPen *pen, const GpRectF
return Ok;
}
GpStatus METAFILE_DrawArc(GpMetafile *metafile, GpPen *pen, const GpRectF *rect, REAL startAngle, REAL sweepAngle)
{
EmfPlusDrawArc *record;
GpStatus stat;
BOOL integer_rect;
DWORD pen_id;
if (metafile->metafile_type == MetafileTypeEmf)
{
FIXME("stub!\n");
return NotImplemented;
}
stat = METAFILE_AddPenObject(metafile, pen, &pen_id);
if (stat != Ok) return stat;
integer_rect = is_integer_rect(rect);
stat = METAFILE_AllocateRecord(metafile, FIELD_OFFSET(EmfPlusDrawArc, RectData) +
integer_rect ? sizeof(record->RectData.rect) : sizeof(record->RectData.rectF),
(void **)&record);
if (stat != Ok)
return stat;
record->Header.Type = EmfPlusRecordTypeDrawArc;
record->Header.Flags = pen_id;
if (integer_rect)
record->Header.Flags |= 0x4000;
record->StartAngle = startAngle;
record->SweepAngle = sweepAngle;
if (integer_rect)
{
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;
}
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