gdi32: Implement PolylineTo in enhanced metafiles.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-06-17 14:00:17 +09:00
parent e92e5ec376
commit 91ef88a9e3
4 changed files with 31 additions and 14 deletions

View File

@ -98,6 +98,7 @@ extern BOOL EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* cou
extern BOOL EMFDRV_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polys) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_PolylineTo( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN;
extern BOOL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,

View File

@ -389,7 +389,7 @@ EMFDRV_Polylinegon( PHYSDEV dev, const POINT* pt, INT count, DWORD iType )
return ret;
}
if(iType == EMR_POLYBEZIERTO) {
if(iType == EMR_POLYBEZIERTO || iType == EMR_POLYLINETO) {
POINT cur_pt;
GetCurrentPositionEx( dev->hdc, &cur_pt );
@ -467,7 +467,7 @@ EMFDRV_Polylinegon16( PHYSDEV dev, const POINT* pt, INT count, DWORD iType )
return ret;
}
if(iType == EMR_POLYBEZIERTO16) {
if(iType == EMR_POLYBEZIERTO16 || iType == EMR_POLYLINETO16) {
POINT cur_pt;
GetCurrentPositionEx( dev->hdc, &cur_pt );
@ -511,6 +511,16 @@ BOOL EMFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
return EMFDRV_Polylinegon( dev, pt, count, EMR_POLYLINE );
}
/**********************************************************************
* EMFDRV_PolylineTo
*/
BOOL EMFDRV_PolylineTo( PHYSDEV dev, const POINT* pt, INT count )
{
if( EMFDRV_Polylinegon16( dev, pt, count, EMR_POLYLINETO16 ) )
return TRUE;
return EMFDRV_Polylinegon( dev, pt, count, EMR_POLYLINETO );
}
/**********************************************************************
* EMFDRV_Polygon
*/

View File

@ -111,7 +111,7 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
EMFDRV_PolyPolyline, /* pPolyPolyline */
EMFDRV_Polygon, /* pPolygon */
EMFDRV_Polyline, /* pPolyline */
NULL, /* pPolylineTo */
EMFDRV_PolylineTo, /* pPolylineTo */
NULL, /* pPutImage */
NULL, /* pRealizeDefaultPalette */
NULL, /* pRealizePalette */

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,
0x34, 0x02, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
0x60, 0x02, 0x00, 0x00, 0x13, 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,
@ -3655,17 +3655,22 @@ static const unsigned char EMF_PATH_BITS[] =
0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00,
0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x0a, 0x00,
0x0a, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00,
0x5a, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
0x59, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x0a, 0x00,
0x0a, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 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
0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00,
0x14, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00,
0x14, 0x00, 0x14, 0x00, 0x5a, 0x00, 0x00, 0x00,
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00,
0x14, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00,
0x14, 0x00, 0x14, 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
};
static void test_emf_GetPath(void)
@ -3700,11 +3705,12 @@ static void test_emf_GetPath(void)
Ellipse(hdcMetafile, 10, 10, 20, 20);
RoundRect(hdcMetafile, 10, 10, 20, 20, 3, 5);
Polyline(hdcMetafile, pts, 4);
PolylineTo(hdcMetafile, pts, 4);
PolyPolyline(hdcMetafile, pts, counts, 2);
EndPath(hdcMetafile);
size = GetPath(hdcMetafile, NULL, NULL, 0);
todo_wine ok( size == 88, "GetPath returned %d.\n", size);
todo_wine ok( size == 93, "GetPath returned %d.\n", size);
hemf = CloseEnhMetaFile(hdcMetafile);
ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());