gdi32: Use NtGdiExtFloodFill for ExtFloodFill implementation.

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:
Jacek Caban 2021-07-25 10:57:58 +02:00 committed by Alexandre Julliard
parent 23f6b8b473
commit 0dd6b238aa
9 changed files with 39 additions and 26 deletions

View File

@ -71,7 +71,6 @@ extern BOOL CDECL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, I
extern BOOL CDECL EMFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN;
extern INT CDECL EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str,
UINT count, const INT *lpDx ) DECLSPEC_HIDDEN;

View File

@ -792,9 +792,9 @@ BOOL CDECL EMFDRV_PolyDraw( PHYSDEV dev, const POINT *pts, const BYTE *types, DW
/**********************************************************************
* EMFDRV_ExtFloodFill
* EMFDC_ExtFloodFill
*/
BOOL CDECL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType )
BOOL EMFDC_ExtFloodFill( DC_ATTR *dc_attr, INT x, INT y, COLORREF color, UINT fill_type )
{
EMREXTFLOODFILL emr;
@ -803,9 +803,9 @@ BOOL CDECL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT
emr.ptlStart.x = x;
emr.ptlStart.y = y;
emr.crColor = color;
emr.iMode = fillType;
emr.iMode = fill_type;
return EMFDRV_WriteRecord( dev, &emr.emr );
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}

View File

@ -60,7 +60,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_ExcludeClipRect, /* pExcludeClipRect */
NULL, /* pExtDeviceMode */
NULL, /* pExtEscape */
EMFDRV_ExtFloodFill, /* pExtFloodFill */
NULL, /* pExtFloodFill */
EMFDRV_ExtSelectClipRgn, /* pExtSelectClipRgn */
EMFDRV_ExtTextOut, /* pExtTextOut */
EMFDRV_FillPath, /* pFillPath */

View File

@ -47,6 +47,8 @@ extern BOOL METADC_Arc( HDC hdc, INT left, INT top, INT right, INT bottom,
extern BOOL METADC_Chord( HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart,
INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_Ellipse( HDC hdc, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color,
UINT fill_type ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN;
extern BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
@ -78,6 +80,8 @@ extern BOOL EMFDC_CloseFigure( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_Ellipse( DC_ATTR *dc_attr, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_EndPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExtFloodFill( DC_ATTR *dc_attr, INT x, INT y, COLORREF color,
UINT fill_type ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const RECT *rect,
const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FillRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;

View File

@ -443,6 +443,29 @@ BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn )
return NtGdiInvertRgn( hdc, hrgn );
}
/***********************************************************************
* ExtFloodFill (GDI32.@)
*/
BOOL WINAPI ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT fill_type )
{
DC_ATTR *dc_attr;
TRACE( "%p, (%d, %d), %08x, %x\n", hdc, x, y, color, fill_type );
if (is_meta_dc( hdc )) return METADC_ExtFloodFill( hdc, x, y, color, fill_type );
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_ExtFloodFill( dc_attr, x, y, color, fill_type )) return FALSE;
return NtGdiExtFloodFill( hdc, x, y, color, fill_type );
}
/***********************************************************************
* FloodFill (GDI32.@)
*/
BOOL WINAPI FloodFill( HDC hdc, INT x, INT y, COLORREF color )
{
return ExtFloodFill( hdc, x, y, color, FLOODFILLBORDER );
}
/***********************************************************************
* ExtTextOutW (GDI32.@)
*/

View File

@ -248,12 +248,11 @@ BOOL METADC_PolyPolygon( HDC hdc, const POINT *pt, const INT *counts, UINT polyg
/**********************************************************************
* MFDRV_ExtFloodFill
* METADC_ExtFloodFill
*/
BOOL CDECL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType )
BOOL METADC_ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT fillType )
{
return MFDRV_MetaParam4(dev,META_FLOODFILL,x,y,HIWORD(color),
LOWORD(color));
return metadc_param4( hdc, META_FLOODFILL, x, y, HIWORD(color), LOWORD(color) );
}

View File

@ -123,7 +123,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_ExcludeClipRect, /* pExcludeClipRect */
NULL, /* pExtDeviceMode */
MFDRV_ExtEscape, /* pExtEscape */
MFDRV_ExtFloodFill, /* pExtFloodFill */
NULL, /* pExtFloodFill */
MFDRV_ExtSelectClipRgn, /* pExtSelectClipRgn */
NULL, /* pExtTextOut */
MFDRV_FillPath, /* pFillPath */

View File

@ -80,7 +80,6 @@ extern BOOL CDECL MFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;

View File

@ -597,34 +597,23 @@ ULONG WINAPI NtGdiPolyPolyDraw( HDC hdc, const POINT *points, const UINT *counts
}
/**********************************************************************
* ExtFloodFill (GDI32.@)
* NtGdiExtFloodFill (win32u.@)
*/
BOOL WINAPI ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color,
UINT fillType )
BOOL WINAPI NtGdiExtFloodFill( HDC hdc, INT x, INT y, COLORREF color, UINT fill_type )
{
PHYSDEV physdev;
BOOL ret;
DC * dc = get_dc_ptr( hdc );
TRACE( "%p, (%d, %d), %08x, %x\n", hdc, x, y, color, fillType );
if (!dc) return FALSE;
update_dc( dc );
physdev = GET_DC_PHYSDEV( dc, pExtFloodFill );
ret = physdev->funcs->pExtFloodFill( physdev, x, y, color, fillType );
ret = physdev->funcs->pExtFloodFill( physdev, x, y, color, fill_type );
release_dc_ptr( dc );
return ret;
}
/**********************************************************************
* FloodFill (GDI32.@)
*/
BOOL WINAPI FloodFill( HDC hdc, INT x, INT y, COLORREF color )
{
return ExtFloodFill( hdc, x, y, color, FLOODFILLBORDER );
}
/***********************************************************************
* NtGdiAngleArc (win32u.@)
*/