Commit c7bbc830 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Implement bounds for FillPath, StrokeAndFillPath and StrokePath in enhanced metafiles.

parent 625ff9b5
......@@ -471,20 +471,6 @@ BOOL EMFDRV_EndPath( PHYSDEV dev )
return FALSE; /* always fails without a path */
}
BOOL EMFDRV_FillPath( PHYSDEV dev )
{
EMRFILLPATH emr;
emr.emr.iType = EMR_FILLPATH;
emr.emr.nSize = sizeof(emr);
FIXME("Bounds\n");
emr.rclBounds.left = 0;
emr.rclBounds.top = 0;
emr.rclBounds.right = 0;
emr.rclBounds.bottom = 0;
return EMFDRV_WriteRecord( dev, &emr.emr );
}
BOOL EMFDRV_FlattenPath( PHYSDEV dev )
{
EMRFLATTENPATH emr;
......@@ -508,34 +494,6 @@ BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode )
return next->funcs->pSelectClipPath( next, iMode );
}
BOOL EMFDRV_StrokeAndFillPath( PHYSDEV dev )
{
EMRSTROKEANDFILLPATH emr;
emr.emr.iType = EMR_STROKEANDFILLPATH;
emr.emr.nSize = sizeof(emr);
FIXME("Bounds\n");
emr.rclBounds.left = 0;
emr.rclBounds.top = 0;
emr.rclBounds.right = 0;
emr.rclBounds.bottom = 0;
return EMFDRV_WriteRecord( dev, &emr.emr );
}
BOOL EMFDRV_StrokePath( PHYSDEV dev )
{
EMRSTROKEPATH emr;
emr.emr.iType = EMR_STROKEPATH;
emr.emr.nSize = sizeof(emr);
FIXME("Bounds\n");
emr.rclBounds.left = 0;
emr.rclBounds.top = 0;
emr.rclBounds.right = 0;
emr.rclBounds.bottom = 0;
return EMFDRV_WriteRecord( dev, &emr.emr );
}
BOOL EMFDRV_WidenPath( PHYSDEV dev )
{
EMRWIDENPATH emr;
......
......@@ -96,6 +96,32 @@ static void get_points_bounds( RECTL *bounds, const POINT *pts, UINT count, HDC
}
}
/* helper for path stroke and fill functions */
static BOOL emfdrv_stroke_and_fill_path( PHYSDEV dev, INT type )
{
EMRSTROKEANDFILLPATH emr;
int count;
POINT *points;
BYTE *flags;
emr.emr.iType = type;
emr.emr.nSize = sizeof(emr);
count = get_gdi_flat_path( dev->hdc, &points, &flags, NULL );
if (count >= 0)
{
get_points_bounds( &emr.rclBounds, points, count, 0 );
HeapFree( GetProcessHeap(), 0, points );
HeapFree( GetProcessHeap(), 0, flags );
}
else emr.rclBounds = empty_bounds;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
if (count < 0) return FALSE;
EMFDRV_UpdateBBox( dev, &emr.rclBounds );
return TRUE;
}
/**********************************************************************
* EMFDRV_MoveTo
*/
......@@ -961,3 +987,27 @@ BOOL EMFDRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
HeapFree( GetProcessHeap(), 0, emr );
return ret;
}
/**********************************************************************
* EMFDRV_FillPath
*/
BOOL EMFDRV_FillPath( PHYSDEV dev )
{
return emfdrv_stroke_and_fill_path( dev, EMR_FILLPATH );
}
/**********************************************************************
* EMFDRV_StrokeAndFillPath
*/
BOOL EMFDRV_StrokeAndFillPath( PHYSDEV dev )
{
return emfdrv_stroke_and_fill_path( dev, EMR_STROKEANDFILLPATH );
}
/**********************************************************************
* EMFDRV_MoveTo
*/
BOOL EMFDRV_StrokePath( PHYSDEV dev )
{
return emfdrv_stroke_and_fill_path( dev, EMR_STROKEPATH );
}
......@@ -3583,12 +3583,12 @@ static void test_emf_polybezier(void)
static const unsigned char EMF_PATH_BITS[] =
{
0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xd8, 0xff, 0xff, 0xff, 0xd8, 0xff, 0xff, 0xff,
0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x96, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00,
0x90, 0x01, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00,
0x70, 0x17, 0x00, 0x00, 0x70, 0x17, 0x00, 0x00,
0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
0xc8, 0x02, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
0xf8, 0x02, 0x00, 0x00, 0x17, 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,
......@@ -3668,7 +3668,13 @@ static const unsigned char EMF_PATH_BITS[] =
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,
0x08, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00,
0x96, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
};
......@@ -3745,6 +3751,11 @@ static void test_emf_paths(void)
size = GetPath(hdcMetafile, NULL, NULL, 0);
todo_wine ok( size == 112, "GetPath returned %d.\n", size);
ret = StrokeAndFillPath( hdcMetafile );
ok( ret, "StrokeAndFillPath failed err %d\n", GetLastError() );
ret = StrokeAndFillPath( hdcMetafile );
ok( !ret, "StrokeAndFillPath succeeded\n" );
hemf = CloseEnhMetaFile(hdcMetafile);
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