diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h index e9ef3159888..fd2f85ba1d1 100644 --- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h @@ -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; diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index eadf9a1a4b9..64b85c44cb1 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -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 ); } /********************************************************************** diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index b57bb2d2f64..ad5e05a534d 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -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 */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 5714aee0099..fcf0a1647b3 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -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, diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 956326b7c14..7ba1aecdca1 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -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.@) */ diff --git a/dlls/gdi32/mfdrv/graphics.c b/dlls/gdi32/mfdrv/graphics.c index 56f93aa860d..dcfc481119f 100644 --- a/dlls/gdi32/mfdrv/graphics.c +++ b/dlls/gdi32/mfdrv/graphics.c @@ -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 ); } diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 5d32c5563de..c40f892a9a1 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -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 */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 9809f3e2a11..09c9b793e43 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -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, diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index eb537a44574..6ff24f622c7 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -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.@) */