gdi32: Handle metafiles directly in Chord and Pie implementations.

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-17 17:01:18 +02:00 committed by Alexandre Julliard
parent 95b3504e1e
commit b70616b508
5 changed files with 38 additions and 16 deletions

View File

@ -37,7 +37,11 @@ static inline BOOL is_meta_dc( HDC hdc )
return (handle & NTGDI_HANDLE_TYPE_MASK) >> NTGDI_HANDLE_TYPE_SHIFT == NTGDI_OBJ_METADC; return (handle & NTGDI_HANDLE_TYPE_MASK) >> NTGDI_HANDLE_TYPE_SHIFT == NTGDI_OBJ_METADC;
} }
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_LineTo( HDC hdc, INT x, INT y ) 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_MoveTo( HDC hdc, INT x, INT y ) 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;
#endif /* __WINE_GDI_PRIVATE_H */ #endif /* __WINE_GDI_PRIVATE_H */

View File

@ -81,6 +81,10 @@ BOOL WINAPI Chord( HDC hdc, INT left, INT top, INT right, INT bottom,
TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top, TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top,
right, bottom, xstart, ystart, xend, yend ); right, bottom, xstart, ystart, xend, yend );
if (is_meta_dc( hdc ))
return METADC_Chord( hdc, left, top, right, bottom,
xstart, ystart, xend, yend );
return NtGdiArcInternal( NtGdiChord, hdc, left, top, right, bottom, return NtGdiArcInternal( NtGdiChord, hdc, left, top, right, bottom,
xstart, ystart, xend, yend ); xstart, ystart, xend, yend );
} }
@ -94,6 +98,10 @@ BOOL WINAPI Pie( HDC hdc, INT left, INT top, INT right, INT bottom,
TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top, TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top,
right, bottom, xstart, ystart, xend, yend ); right, bottom, xstart, ystart, xend, yend );
if (is_meta_dc( hdc ))
return METADC_Pie( hdc, left, top, right, bottom,
xstart, ystart, xend, yend );
return NtGdiArcInternal( NtGdiPie, hdc, left, top, right, bottom, return NtGdiArcInternal( NtGdiPie, hdc, left, top, right, bottom,
xstart, ystart, xend, yend ); xstart, ystart, xend, yend );
} }

View File

@ -59,24 +59,24 @@ BOOL CDECL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
/*********************************************************************** /***********************************************************************
* MFDRV_Pie * METADC_Pie
*/ */
BOOL CDECL MFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, BOOL METADC_Pie( HDC hdc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) INT xstart, INT ystart, INT xend, INT yend )
{ {
return MFDRV_MetaParam8(dev, META_PIE, left, top, right, bottom, return metadc_param8( hdc, META_PIE, left, top, right, bottom,
xstart, ystart, xend, yend); xstart, ystart, xend, yend );
} }
/*********************************************************************** /***********************************************************************
* MFDRV_Chord * METADC_Chord
*/ */
BOOL CDECL MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom, BOOL METADC_Chord( HDC hdc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) INT xstart, INT ystart, INT xend, INT yend )
{ {
return MFDRV_MetaParam8(dev, META_CHORD, left, top, right, bottom, return metadc_param8( hdc, META_CHORD, left, top, right, bottom,
xstart, ystart, xend, yend); xstart, ystart, xend, yend );
} }
/*********************************************************************** /***********************************************************************

View File

@ -107,7 +107,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pArcTo */ NULL, /* pArcTo */
MFDRV_BeginPath, /* pBeginPath */ MFDRV_BeginPath, /* pBeginPath */
NULL, /* pBlendImage */ NULL, /* pBlendImage */
MFDRV_Chord, /* pChord */ NULL, /* pChord */
MFDRV_CloseFigure, /* pCloseFigure */ MFDRV_CloseFigure, /* pCloseFigure */
MFDRV_CreateCompatibleDC, /* pCreateCompatibleDC */ MFDRV_CreateCompatibleDC, /* pCreateCompatibleDC */
NULL, /* pCreateDC */ NULL, /* pCreateDC */
@ -167,7 +167,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */ MFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */
MFDRV_PaintRgn, /* pPaintRgn */ MFDRV_PaintRgn, /* pPaintRgn */
MFDRV_PatBlt, /* pPatBlt */ MFDRV_PatBlt, /* pPatBlt */
MFDRV_Pie, /* pPie */ NULL, /* pPie */
MFDRV_PolyBezier, /* pPolyBezier */ MFDRV_PolyBezier, /* pPolyBezier */
MFDRV_PolyBezierTo, /* pPolyBezierTo */ MFDRV_PolyBezierTo, /* pPolyBezierTo */
NULL, /* pPolyDraw */ NULL, /* pPolyDraw */
@ -613,3 +613,14 @@ BOOL metadc_param2( HDC hdc, short func, short param1, short param2 )
if (!(dev = get_metadc_ptr( hdc ))) return FALSE; if (!(dev = get_metadc_ptr( hdc ))) return FALSE;
return MFDRV_MetaParam2( &dev->dev, func, param1, param2 ); return MFDRV_MetaParam2( &dev->dev, func, param1, param2 );
} }
BOOL metadc_param8( HDC hdc, short func, short param1, short param2,
short param3, short param4, short param5,
short param6, short param7, short param8)
{
METAFILEDRV_PDEVICE *dev;
if (!(dev = get_metadc_ptr( hdc ))) return FALSE;
return MFDRV_MetaParam8( &dev->dev, func, param1, param2, param3,
param4, param5, param6, param7, param8 );
}

View File

@ -60,6 +60,9 @@ extern BOOL MFDRV_RemoveHandle( PHYSDEV dev, UINT index ) DECLSPEC_HIDDEN;
extern INT16 MFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_HIDDEN; extern INT16 MFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_HIDDEN;
extern BOOL metadc_param2( HDC hdc, short func, short param1, short param2 ) DECLSPEC_HIDDEN; extern BOOL metadc_param2( HDC hdc, short func, short param1, short param2 ) DECLSPEC_HIDDEN;
extern BOOL metadc_param8( HDC hdc, short func, short param1, short param2,
short param3, short param4, short param5, short param6,
short param7, short param8 ) DECLSPEC_HIDDEN;
/* Metafile driver functions */ /* Metafile driver functions */
@ -67,8 +70,6 @@ extern BOOL CDECL MFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, extern BOOL CDECL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN; INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
@ -89,8 +90,6 @@ extern BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *p
extern BOOL CDECL MFDRV_OffsetWindowOrgEx( 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_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_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count ) 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; extern BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygons) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygons) DECLSPEC_HIDDEN;