gdi32: Pass a DC pointer to get_gdi_flat_path().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-07-29 15:09:26 +01:00 committed by Alexandre Julliard
parent 0c1e42235a
commit 67520ebaf5
4 changed files with 7 additions and 9 deletions

View file

@ -408,6 +408,7 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
/* helper for path stroking and filling functions */
static BOOL stroke_and_fill_path( dibdrv_physdev *dev, BOOL stroke, BOOL fill )
{
DC *dc = get_physdev_dc( &dev->dev );
struct gdi_path *path;
POINT *points;
BYTE *types;
@ -417,7 +418,7 @@ static BOOL stroke_and_fill_path( dibdrv_physdev *dev, BOOL stroke, BOOL fill )
if (dev->brush.style == BS_NULL) fill = FALSE;
if (!(path = get_gdi_flat_path( dev->dev.hdc, fill ? &interior : NULL ))) return FALSE;
if (!(path = get_gdi_flat_path( dc, fill ? &interior : NULL ))) return FALSE;
if (!(total = get_gdi_path_data( path, &points, &types ))) goto done;
if (stroke && dev->pen_uses_region) outline = CreateRectRgn( 0, 0, 0, 0 );

View file

@ -99,6 +99,7 @@ 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 )
{
DC *dc = get_physdev_dc( dev );
EMRSTROKEANDFILLPATH emr;
struct gdi_path *path;
POINT *points;
@ -107,7 +108,7 @@ static BOOL emfdrv_stroke_and_fill_path( PHYSDEV dev, INT type )
emr.emr.iType = type;
emr.emr.nSize = sizeof(emr);
if ((path = get_gdi_flat_path( dev->hdc, NULL )))
if ((path = get_gdi_flat_path( dc, NULL )))
{
int count = get_gdi_path_data( path, &points, &flags );
get_points_bounds( &emr.rclBounds, points, count, 0 );

View file

@ -334,7 +334,7 @@ typedef struct
/* path.c */
extern void free_gdi_path( struct gdi_path *path ) DECLSPEC_HIDDEN;
extern struct gdi_path *get_gdi_flat_path( HDC hdc, HRGN *rgn ) DECLSPEC_HIDDEN;
extern struct gdi_path *get_gdi_flat_path( DC *dc, HRGN *rgn ) DECLSPEC_HIDDEN;
extern int get_gdi_path_data( struct gdi_path *path, POINT **points, BYTE **flags ) DECLSPEC_HIDDEN;
extern BOOL PATH_SavePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
extern BOOL PATH_RestorePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;

View file

@ -536,24 +536,20 @@ static BOOL PATH_DoArcPart(struct gdi_path *pPath, FLOAT_POINT corners[],
/* retrieve a flattened path in device coordinates, and optionally its region */
/* the DC path is deleted; the returned data must be freed by caller using free_gdi_path() */
/* helper for stroke_and_fill_path in the DIB driver */
struct gdi_path *get_gdi_flat_path( HDC hdc, HRGN *rgn )
struct gdi_path *get_gdi_flat_path( DC *dc, HRGN *rgn )
{
DC *dc = get_dc_ptr( hdc );
struct gdi_path *ret = NULL;
if (!dc) return NULL;
if (dc->path)
{
ret = PATH_FlattenPath( dc->path );
free_gdi_path( dc->path );
dc->path = NULL;
if (ret && rgn) *rgn = path_to_region( ret, GetPolyFillMode( hdc ) );
if (ret && rgn) *rgn = path_to_region( ret, dc->polyFillMode );
}
else SetLastError( ERROR_CAN_NOT_COMPLETE );
release_dc_ptr( dc );
return ret;
}