Commit e92e5ec3 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Implement ArcTo in enhanced metafiles.

parent bee56c33
...@@ -56,6 +56,8 @@ extern DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_H ...@@ -56,6 +56,8 @@ extern DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_H
extern BOOL EMFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL EMFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, extern BOOL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN; INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_ArcTo( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL EMFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height, extern BOOL EMFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height,
PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop ) DECLSPEC_HIDDEN; PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop ) DECLSPEC_HIDDEN;
......
...@@ -177,6 +177,15 @@ EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, ...@@ -177,6 +177,15 @@ EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
if(bounds.top > yCentre) bounds.top = yCentre; if(bounds.top > yCentre) bounds.top = yCentre;
else if(bounds.bottom < yCentre) bounds.bottom = yCentre; else if(bounds.bottom < yCentre) bounds.bottom = yCentre;
} }
if (iType == EMR_ARCTO)
{
POINT pt;
GetCurrentPositionEx( dev->hdc, &pt );
bounds.left = min( bounds.left, pt.x );
bounds.top = min( bounds.top, pt.y );
bounds.right = max( bounds.right, pt.x );
bounds.bottom = max( bounds.bottom, pt.y );
}
if(!EMFDRV_WriteRecord( dev, &emr.emr )) if(!EMFDRV_WriteRecord( dev, &emr.emr ))
return FALSE; return FALSE;
if(!physDev->path) if(!physDev->path)
...@@ -196,6 +205,16 @@ BOOL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, ...@@ -196,6 +205,16 @@ BOOL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
} }
/*********************************************************************** /***********************************************************************
* EMFDRV_ArcTo
*/
BOOL EMFDRV_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
xend, yend, EMR_ARCTO );
}
/***********************************************************************
* EMFDRV_Pie * EMFDRV_Pie
*/ */
BOOL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, BOOL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
......
...@@ -41,7 +41,7 @@ static const struct gdi_dc_funcs EMFDRV_Funcs = ...@@ -41,7 +41,7 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
NULL, /* pAlphaBlend */ NULL, /* pAlphaBlend */
NULL, /* pAngleArc */ NULL, /* pAngleArc */
EMFDRV_Arc, /* pArc */ EMFDRV_Arc, /* pArc */
NULL, /* pArcTo */ EMFDRV_ArcTo, /* pArcTo */
EMFDRV_BeginPath, /* pBeginPath */ EMFDRV_BeginPath, /* pBeginPath */
NULL, /* pBlendImage */ NULL, /* pBlendImage */
EMFDRV_Chord, /* pChord */ EMFDRV_Chord, /* pChord */
......
...@@ -3599,12 +3599,12 @@ static const unsigned char EMF_PATH_BITS[] = ...@@ -3599,12 +3599,12 @@ static const unsigned char EMF_PATH_BITS[] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xef, 0xff, 0xff, 0xff, 0xea, 0xff, 0xff, 0xff, 0xd8, 0xff, 0xff, 0xff, 0xd8, 0xff, 0xff, 0xff,
0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00, 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
0x0c, 0x02, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x07, 0x00, 0x00, 0x3e, 0x04, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00,
0x40, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x04, 0x00,
...@@ -3627,7 +3627,12 @@ static const unsigned char EMF_PATH_BITS[] = ...@@ -3627,7 +3627,12 @@ static const unsigned char EMF_PATH_BITS[] =
0x15, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
0x1c, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
0x1d, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
0x15, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
0x28, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
0x17, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
0x1a, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
0x1b, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
0x17, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00,
0x28, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
0x15, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
0x1c, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
...@@ -3689,6 +3694,7 @@ static void test_emf_GetPath(void) ...@@ -3689,6 +3694,7 @@ static void test_emf_GetPath(void)
ok( ret, "LineTo error %d.\n", GetLastError()); ok( ret, "LineTo error %d.\n", GetLastError());
Rectangle(hdcMetafile, 10, 10, 20, 20); Rectangle(hdcMetafile, 10, 10, 20, 20);
Arc(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21); Arc(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21);
ArcTo(hdcMetafile, 23, 23, 37, 27, 37, 27, 23, 23);
Chord(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21); Chord(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21);
Pie(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21); Pie(hdcMetafile, 21, 21, 39, 29, 39, 29, 21, 21);
Ellipse(hdcMetafile, 10, 10, 20, 20); Ellipse(hdcMetafile, 10, 10, 20, 20);
...@@ -3698,7 +3704,7 @@ static void test_emf_GetPath(void) ...@@ -3698,7 +3704,7 @@ static void test_emf_GetPath(void)
EndPath(hdcMetafile); EndPath(hdcMetafile);
size = GetPath(hdcMetafile, NULL, NULL, 0); size = GetPath(hdcMetafile, NULL, NULL, 0);
todo_wine ok( size == 77, "GetPath returned %d.\n", size); todo_wine ok( size == 88, "GetPath returned %d.\n", size);
hemf = CloseEnhMetaFile(hdcMetafile); hemf = CloseEnhMetaFile(hdcMetafile);
ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());
......
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