gdi32: Use NtGdiGetRgnBox in emfdrv_stroke_and_fill_path.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0e8a7a5050
commit
478fa71f5f
|
@ -94,25 +94,21 @@ static void get_points_bounds( RECTL *bounds, const POINT *pts, UINT count, DC_A
|
||||||
/* helper for path stroke and fill functions */
|
/* helper for path stroke and fill functions */
|
||||||
static BOOL emfdrv_stroke_and_fill_path( struct emf *emf, INT type )
|
static BOOL emfdrv_stroke_and_fill_path( struct emf *emf, INT type )
|
||||||
{
|
{
|
||||||
DC *dc = get_physdev_dc( &emf->dev );
|
|
||||||
EMRSTROKEANDFILLPATH emr;
|
EMRSTROKEANDFILLPATH emr;
|
||||||
struct gdi_path *path;
|
HRGN region;
|
||||||
POINT *points;
|
|
||||||
BYTE *flags;
|
|
||||||
|
|
||||||
emr.emr.iType = type;
|
emr.emr.iType = type;
|
||||||
emr.emr.nSize = sizeof(emr);
|
emr.emr.nSize = sizeof(emr);
|
||||||
|
emr.rclBounds = empty_bounds;
|
||||||
|
|
||||||
if ((path = get_gdi_flat_path( dc, NULL )))
|
if ((region = NtGdiPathToRegion( emf->dc_attr->hdc )))
|
||||||
{
|
{
|
||||||
int count = get_gdi_path_data( path, &points, &flags );
|
NtGdiGetRgnBox( region, (RECT *)&emr.rclBounds );
|
||||||
get_points_bounds( &emr.rclBounds, points, count, 0 );
|
DeleteObject( region );
|
||||||
free_gdi_path( path );
|
|
||||||
}
|
}
|
||||||
else emr.rclBounds = empty_bounds;
|
|
||||||
|
|
||||||
if (!emfdc_record( emf, &emr.emr )) return FALSE;
|
if (!emfdc_record( emf, &emr.emr )) return FALSE;
|
||||||
if (!path) return FALSE;
|
if (!region) return FALSE;
|
||||||
emfdc_update_bounds( emf, &emr.rclBounds );
|
emfdc_update_bounds( emf, &emr.rclBounds );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue