gdi32: Use NtGdiAngleArc for AngleArc 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-20 09:20:02 +02:00 committed by Alexandre Julliard
parent 0636b36013
commit 3713901dff
7 changed files with 24 additions and 22 deletions

View File

@ -600,18 +600,6 @@ static BOOL CDECL emfpathdrv_AbortPath( PHYSDEV dev )
return next->funcs->pAbortPath( next );
}
/***********************************************************************
* emfpathdrv_AngleArc
*/
static BOOL CDECL emfpathdrv_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep )
{
PHYSDEV emfdev = get_emfdev( dev );
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pAngleArc );
return (emfdev->funcs->pAngleArc( emfdev, x, y, radius, start, sweep ) &&
next->funcs->pAngleArc( next, x, y, radius, start, sweep ));
}
/***********************************************************************
* emfpathdrv_BeginPath
*/
@ -785,7 +773,7 @@ static const struct gdi_dc_funcs emfpath_driver =
NULL, /* pAbortDoc */
emfpathdrv_AbortPath, /* pAbortPath */
NULL, /* pAlphaBlend */
emfpathdrv_AngleArc, /* pAngleArc */
NULL, /* pAngleArc */
NULL, /* pArc */
NULL, /* pArcTo */
emfpathdrv_BeginPath, /* pBeginPath */

View File

@ -61,7 +61,6 @@ extern DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_H
extern BOOL CDECL EMFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst,
PHYSDEV dev_src, struct bitblt_coords *src, BLENDFUNCTION func ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_ArcTo( PHYSDEV dev, INT left, INT top, INT right,

View File

@ -355,9 +355,9 @@ BOOL CDECL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
}
/***********************************************************************
* EMFDRV_AngleArc
* EMFDC_AngleArc
*/
BOOL CDECL EMFDRV_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep )
BOOL EMFDC_AngleArc( DC_ATTR *dc_attr, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep )
{
EMRANGLEARC emr;
@ -369,7 +369,7 @@ BOOL CDECL EMFDRV_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT start
emr.eStartAngle = start;
emr.eSweepAngle = sweep;
return EMFDRV_WriteRecord( dev, &emr.emr );
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}
/***********************************************************************

View File

@ -39,7 +39,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
NULL, /* pAbortDoc */
EMFDRV_AbortPath, /* pAbortPath */
EMFDRV_AlphaBlend, /* pAlphaBlend */
EMFDRV_AngleArc, /* pAngleArc */
NULL, /* pAngleArc */
EMFDRV_Arc, /* pArc */
EMFDRV_ArcTo, /* pArcTo */
EMFDRV_BeginPath, /* pBeginPath */

View File

@ -56,6 +56,8 @@ extern BOOL METADC_RoundRect( HDC hdc, INT left, INT top, INT right, INT bottom,
INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
/* enhanced metafiles */
extern BOOL EMFDC_AngleArc( DC_ATTR *dc_attr, INT x, INT y, DWORD radius, FLOAT start,
FLOAT sweep ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ArcChordPie( DC_ATTR *dc_attr, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend,
INT yend, DWORD type ) DECLSPEC_HIDDEN;

View File

@ -170,6 +170,21 @@ BOOL WINAPI Pie( HDC hdc, INT left, INT top, INT right, INT bottom,
xstart, ystart, xend, yend );
}
/***********************************************************************
* AngleArc (GDI32.@)
*/
BOOL WINAPI AngleArc( HDC hdc, INT x, INT y, DWORD radius, FLOAT start_angle, FLOAT sweep_angle )
{
DC_ATTR *dc_attr;
TRACE( "%p, (%d, %d), %u, %f, %f\n", hdc, x, y, radius, start_angle, sweep_angle );
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_AngleArc( dc_attr, x, y, radius, start_angle, sweep_angle ))
return FALSE;
return NtGdiAngleArc( hdc, x, y, radius, start_angle, sweep_angle );
}
/***********************************************************************
* Ellipse (GDI32.@)
*/

View File

@ -776,16 +776,14 @@ BOOL WINAPI PolyBezierTo( HDC hdc, const POINT* lppt, DWORD cPoints )
}
/***********************************************************************
* AngleArc (GDI32.@)
* NtGdiAngleArc (win32u.@)
*/
BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, FLOAT eSweepAngle)
BOOL WINAPI NtGdiAngleArc( HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, FLOAT eSweepAngle )
{
PHYSDEV physdev;
BOOL result;
DC *dc;
TRACE( "%p, (%d, %d), %u, %f, %f\n", hdc, x, y, dwRadius, eStartAngle, eSweepAngle );
if( (signed int)dwRadius < 0 )
return FALSE;