gdi32: Implement AngleArc in enhanced metafiles.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-06-17 16:24:54 +09:00
parent b06e6147d1
commit ef3494c623
4 changed files with 30 additions and 7 deletions

View File

@ -54,6 +54,7 @@ extern DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_H
/* Metafile driver functions */
extern BOOL EMFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_ArcTo( PHYSDEV dev, INT left, INT top, INT right,

View File

@ -298,6 +298,24 @@ BOOL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
xend, yend, EMR_CHORD );
}
/***********************************************************************
* EMFDRV_AngleArc
*/
BOOL EMFDRV_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep )
{
EMRANGLEARC emr;
emr.emr.iType = EMR_ANGLEARC;
emr.emr.nSize = sizeof( emr );
emr.ptlCenter.x = x;
emr.ptlCenter.y = y;
emr.nRadius = radius;
emr.eStartAngle = start;
emr.eSweepAngle = sweep;
return EMFDRV_WriteRecord( dev, &emr.emr );
}
/***********************************************************************
* EMFDRV_Ellipse
*/

View File

@ -39,7 +39,7 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
NULL, /* pAbortDoc */
EMFDRV_AbortPath, /* pAbortPath */
NULL, /* pAlphaBlend */
NULL, /* pAngleArc */
EMFDRV_AngleArc, /* pAngleArc */
EMFDRV_Arc, /* pArc */
EMFDRV_ArcTo, /* pArcTo */
EMFDRV_BeginPath, /* pBeginPath */

View File

@ -3601,7 +3601,7 @@ static const unsigned char EMF_PATH_BITS[] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xd8, 0xff, 0xff, 0xff, 0xd8, 0xff, 0xff, 0xff,
0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
0xac, 0x02, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
0xc8, 0x02, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x20, 0x03, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00,
@ -3677,10 +3677,13 @@ static const unsigned char EMF_PATH_BITS[] =
0x14, 0x00, 0x1e, 0x00, 0x14, 0x00, 0x14, 0x00,
0x14, 0x00, 0x0a, 0x00, 0x06, 0x02, 0x04, 0x04,
0x04, 0x02, 0x03, 0x06, 0x02, 0x00, 0x00, 0x00,
0x3c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00
0x29, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x25, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x42,
0x00, 0x00, 0x34, 0x43, 0x3c, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
};
static void test_emf_GetPath(void)
@ -3720,10 +3723,11 @@ static void test_emf_GetPath(void)
PolylineTo(hdcMetafile, pts, 4);
PolyPolyline(hdcMetafile, pts, counts, 2);
PolyDraw(hdcMetafile, pts, types, 9);
AngleArc(hdcMetafile, 37, 36, 23, 90, 180);
EndPath(hdcMetafile);
size = GetPath(hdcMetafile, NULL, NULL, 0);
todo_wine ok( size == 102, "GetPath returned %d.\n", size);
todo_wine ok( size == 112, "GetPath returned %d.\n", size);
hemf = CloseEnhMetaFile(hdcMetafile);
ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());