Jacek Caban : gdi32: Use NtGdiExtFloodFill for ExtFloodFill implementation.
Alexandre Julliard
julliard at winehq.org
Mon Jul 26 15:30:27 CDT 2021
Module: wine
Branch: master
Commit: 0dd6b238aafdf727911a6a88ddaebc32133e5402
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0dd6b238aafdf727911a6a88ddaebc32133e5402
Author: Jacek Caban <jacek at codeweavers.com>
Date: Sun Jul 25 10:57:58 2021 +0200
gdi32: Use NtGdiExtFloodFill for ExtFloodFill implementation.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 1 -
dlls/gdi32/enhmfdrv/graphics.c | 8 ++++----
dlls/gdi32/enhmfdrv/init.c | 2 +-
dlls/gdi32/gdi_private.h | 4 ++++
dlls/gdi32/gdidc.c | 23 +++++++++++++++++++++++
dlls/gdi32/mfdrv/graphics.c | 7 +++----
dlls/gdi32/mfdrv/init.c | 2 +-
dlls/gdi32/mfdrv/metafiledrv.h | 1 -
dlls/gdi32/painting.c | 17 +++--------------
9 files changed, 39 insertions(+), 26 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
index fd2f85ba1d1..6f1ef7c4ad9 100644
--- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
+++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h
@@ -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;
diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c
index 2b61b706560..bcf1b499342 100644
--- a/dlls/gdi32/enhmfdrv/graphics.c
+++ b/dlls/gdi32/enhmfdrv/graphics.c
@@ -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 );
}
diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c
index ad5e05a534d..45ec60c8d33 100644
--- a/dlls/gdi32/enhmfdrv/init.c
+++ b/dlls/gdi32/enhmfdrv/init.c
@@ -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 */
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index 378d85a0c19..8f0cb29a8d4 100644
--- a/dlls/gdi32/gdi_private.h
+++ b/dlls/gdi32/gdi_private.h
@@ -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;
diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c
index 64a5cb06ff0..605294cc6b8 100644
--- a/dlls/gdi32/gdidc.c
+++ b/dlls/gdi32/gdidc.c
@@ -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.@)
*/
diff --git a/dlls/gdi32/mfdrv/graphics.c b/dlls/gdi32/mfdrv/graphics.c
index a240f193a52..0f6b3d75e52 100644
--- a/dlls/gdi32/mfdrv/graphics.c
+++ b/dlls/gdi32/mfdrv/graphics.c
@@ -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) );
}
diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c
index 877f19ed1d7..8961c45d24f 100644
--- a/dlls/gdi32/mfdrv/init.c
+++ b/dlls/gdi32/mfdrv/init.c
@@ -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 */
diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h
index 214de5c52ad..9b4bb2d9e84 100644
--- a/dlls/gdi32/mfdrv/metafiledrv.h
+++ b/dlls/gdi32/mfdrv/metafiledrv.h
@@ -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;
diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c
index 61d1505965d..992f2cfb2b0 100644
--- a/dlls/gdi32/painting.c
+++ b/dlls/gdi32/painting.c
@@ -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.@)
*/
More information about the wine-cvs
mailing list