mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 07:44:47 +00:00
gdiplus/metafile: Implement DrawArc() 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
beefe76c6f
commit
c17cd0fcab
|
@ -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_DrawRectangles(GpMetafile *metafile, GpPen *pen, const GpRectF *rects, INT count) DECLSPEC_HIDDEN;
|
||||||
extern GpStatus METAFILE_FillPie(GpMetafile *metafile, GpBrush *brush, const GpRectF *rect,
|
extern GpStatus METAFILE_FillPie(GpMetafile *metafile, GpBrush *brush, const GpRectF *rect,
|
||||||
REAL startAngle, REAL sweepAngle) DECLSPEC_HIDDEN;
|
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,
|
extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1,
|
||||||
REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN;
|
REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -2595,6 +2595,7 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
|
||||||
{
|
{
|
||||||
GpStatus status;
|
GpStatus status;
|
||||||
GpPath *path;
|
GpPath *path;
|
||||||
|
GpRectF rect;
|
||||||
|
|
||||||
TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y,
|
TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y,
|
||||||
width, height, startAngle, sweepAngle);
|
width, height, startAngle, sweepAngle);
|
||||||
|
@ -2605,6 +2606,12 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
|
||||||
if(graphics->busy)
|
if(graphics->busy)
|
||||||
return ObjectBusy;
|
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);
|
status = GdipCreatePath(FillModeAlternate, &path);
|
||||||
if (status != Ok) return status;
|
if (status != Ok) return status;
|
||||||
|
|
||||||
|
|
|
@ -5205,3 +5205,49 @@ GpStatus METAFILE_DrawRectangles(GpMetafile *metafile, GpPen *pen, const GpRectF
|
||||||
|
|
||||||
return Ok;
|
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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue