gdi32: Use NtGdiFillRgn for PaintRgn 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:56:36 +02:00 committed by Alexandre Julliard
parent d552d7ef68
commit a3a5c7048f
9 changed files with 31 additions and 36 deletions

View file

@ -90,7 +90,6 @@ extern BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xfo
extern INT CDECL EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;

View file

@ -925,11 +925,11 @@ static BOOL EMFDRV_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType )
}
/**********************************************************************
* EMFDRV_PaintRgn
* EMFDC_PaintRgn
*/
BOOL CDECL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn )
BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn )
{
return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_PAINTRGN );
return EMFDRV_PaintInvertRgn( dc_attr->emf, hrgn, EMR_PAINTRGN );
}
/**********************************************************************

View file

@ -102,7 +102,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_OffsetClipRgn, /* pOffsetClipRgn */
EMFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */
EMFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */
EMFDRV_PaintRgn, /* pPaintRgn */
NULL, /* pPaintRgn */
EMFDRV_PatBlt, /* pPatBlt */
EMFDRV_Pie, /* pPie */
EMFDRV_PolyBezier, /* pPolyBezier */

View file

@ -52,6 +52,7 @@ extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *re
extern BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL METADC_Pie( HDC hdc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_PolyPolygon( HDC hdc, const POINT *points, const INT *counts,
@ -80,6 +81,7 @@ extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const
extern BOOL EMFDC_FillRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_LineTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_MoveTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyBezier( DC_ATTR *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyBezierTo( DC_ATTR *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyDraw( DC_ATTR *dc_attr, const POINT *points, const BYTE *types,

View file

@ -397,6 +397,21 @@ BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush )
return NtGdiFillRgn( hdc, hrgn, hbrush );
}
/***********************************************************************
* PaintRgn (GDI32.@)
*/
BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn )
{
DC_ATTR *dc_attr;
TRACE( "%p, %p\n", hdc, hrgn );
if (is_meta_dc( hdc )) return METADC_PaintRgn( hdc, hrgn );
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_PaintRgn( dc_attr, hrgn )) return FALSE;
return NtGdiFillRgn( hdc, hrgn, GetCurrentObject( hdc, OBJ_BRUSH ));
}
/***********************************************************************
* ExtTextOutW (GDI32.@)
*/

View file

@ -354,15 +354,17 @@ static INT16 MFDRV_CreateRegion(PHYSDEV dev, HRGN hrgn)
/**********************************************************************
* MFDRV_PaintRgn
* METADC_PaintRgn
*/
BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn )
BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn )
{
METAFILEDRV_PDEVICE *mf;
INT16 index;
index = MFDRV_CreateRegion( dev, hrgn );
if (!(mf = get_metadc_ptr( hdc ))) return FALSE;
index = MFDRV_CreateRegion( &mf->dev, hrgn );
if(index == -1)
return FALSE;
return MFDRV_MetaParam1( dev, META_PAINTREGION, index );
return MFDRV_MetaParam1( &mf->dev, META_PAINTREGION, index );
}

View file

@ -165,7 +165,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_OffsetClipRgn, /* pOffsetClipRgn */
MFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */
MFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */
MFDRV_PaintRgn, /* pPaintRgn */
NULL, /* pPaintRgn */
MFDRV_PatBlt, /* pPatBlt */
NULL, /* pPie */
MFDRV_PolyBezier, /* pPolyBezier */

View file

@ -91,7 +91,6 @@ extern BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN;
@ -127,7 +126,6 @@ extern BOOL CDECL MFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size )
extern BOOL CDECL MFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst,
PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx,
DWORD cy, INT xSrc, INT ySrc,
UINT startscan, UINT lines, LPCVOID bits,

View file

@ -76,7 +76,8 @@ BOOL CDECL nulldrv_FillRgn( PHYSDEV dev, HRGN rgn, HBRUSH brush )
if ((prev = NtGdiSelectBrush( dev->hdc, brush )))
{
ret = PaintRgn( dev->hdc, rgn );
PHYSDEV physdev = GET_DC_PHYSDEV( get_physdev_dc( dev ), pPaintRgn );
ret = physdev->funcs->pPaintRgn( physdev, rgn );
NtGdiSelectBrush( dev->hdc, prev );
}
return ret;
@ -98,10 +99,8 @@ BOOL CDECL nulldrv_FrameRgn( PHYSDEV dev, HRGN rgn, HBRUSH brush, INT width, INT
BOOL CDECL nulldrv_InvertRgn( PHYSDEV dev, HRGN rgn )
{
HBRUSH prev_brush = NtGdiSelectBrush( dev->hdc, GetStockObject(BLACK_BRUSH) );
INT prev_rop = SetROP2( dev->hdc, R2_NOT );
BOOL ret = PaintRgn( dev->hdc, rgn );
NtGdiSelectBrush( dev->hdc, prev_brush );
BOOL ret = NtGdiFillRgn( dev->hdc, rgn, GetStockObject(BLACK_BRUSH) );
SetROP2( dev->hdc, prev_rop );
return ret;
}
@ -473,26 +472,6 @@ BOOL WINAPI NtGdiSwapBuffers( HDC hdc )
}
/***********************************************************************
* PaintRgn (GDI32.@)
*/
BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn )
{
PHYSDEV physdev;
BOOL ret;
DC * dc = get_dc_ptr( hdc );
TRACE( "%p, %p\n", hdc, hrgn );
if (!dc) return FALSE;
update_dc( dc );
physdev = GET_DC_PHYSDEV( dc, pPaintRgn );
ret = physdev->funcs->pPaintRgn( physdev, hrgn );
release_dc_ptr( dc );
return ret;
}
/***********************************************************************
* NtGdiFillRgn (win32u.@)
*/