gdi32: Use NtGdiGradientFill for GdiGradientFill 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:
parent
6762f6ac52
commit
1ca8064c88
|
@ -1116,6 +1116,16 @@ no_bounds:
|
|||
*/
|
||||
BOOL CDECL EMFDRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
|
||||
void *grad_array, ULONG ngrad, ULONG mode )
|
||||
{
|
||||
/* FIXME: update bounding rect */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* EMFDC_GradientFill
|
||||
*/
|
||||
BOOL EMFDC_GradientFill( DC_ATTR *dc_attr, TRIVERTEX *vert_array, ULONG nvert,
|
||||
void *grad_array, ULONG ngrad, ULONG mode )
|
||||
{
|
||||
EMRGRADIENTFILL *emr;
|
||||
ULONG i, pt, size, num_pts = ngrad * (mode == GRADIENT_FILL_TRIANGLE ? 3 : 2);
|
||||
|
@ -1159,8 +1169,8 @@ BOOL CDECL EMFDRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
|
|||
memcpy( emr->Ver, vert_array, nvert * sizeof(vert_array[0]) );
|
||||
memcpy( emr->Ver + nvert, pts, num_pts * sizeof(pts[0]) );
|
||||
|
||||
EMFDRV_UpdateBBox( dev, &emr->rclBounds );
|
||||
ret = EMFDRV_WriteRecord( dev, &emr->emr );
|
||||
EMFDRV_UpdateBBox( dc_attr->emf, &emr->rclBounds );
|
||||
ret = EMFDRV_WriteRecord( dc_attr->emf, &emr->emr );
|
||||
HeapFree( GetProcessHeap(), 0, emr );
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -87,6 +87,8 @@ 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_FrameRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush, INT width,
|
||||
INT height ) DECLSPEC_HIDDEN;
|
||||
extern BOOL EMFDC_GradientFill( DC_ATTR *dc_attr, TRIVERTEX *vert_array, ULONG nvert,
|
||||
void *grad_array, ULONG ngrad, ULONG mode ) DECLSPEC_HIDDEN;
|
||||
extern BOOL EMFDC_InvertRgn( DC_ATTR *dc_attr, HRGN hrgn ) 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;
|
||||
|
|
|
@ -466,6 +466,28 @@ BOOL WINAPI FloodFill( HDC hdc, INT x, INT y, COLORREF color )
|
|||
return ExtFloodFill( hdc, x, y, color, FLOODFILLBORDER );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* GdiGradientFill (GDI32.@)
|
||||
*/
|
||||
BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
|
||||
void *grad_array, ULONG ngrad, ULONG mode )
|
||||
{
|
||||
DC_ATTR *dc_attr;
|
||||
|
||||
TRACE( "%p vert_array:%p nvert:%d grad_array:%p ngrad:%d\n", hdc, vert_array,
|
||||
nvert, grad_array, ngrad );
|
||||
|
||||
if (!(dc_attr = get_dc_attr( hdc )))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
if (dc_attr->emf &&
|
||||
!EMFDC_GradientFill( dc_attr, vert_array, nvert, grad_array, ngrad, mode ))
|
||||
return FALSE;
|
||||
return NtGdiGradientFill( hdc, vert_array, nvert, grad_array, ngrad, mode );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ExtTextOutW (GDI32.@)
|
||||
*/
|
||||
|
|
|
@ -918,18 +918,16 @@ POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut )
|
|||
}
|
||||
|
||||
/******************************************************************************
|
||||
* GdiGradientFill (GDI32.@)
|
||||
* NtGdiGdiGradientFill (win32u.@)
|
||||
*/
|
||||
BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
|
||||
void *grad_array, ULONG ngrad, ULONG mode )
|
||||
BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
|
||||
void *grad_array, ULONG ngrad, ULONG mode )
|
||||
{
|
||||
DC *dc;
|
||||
PHYSDEV physdev;
|
||||
BOOL ret;
|
||||
ULONG i;
|
||||
|
||||
TRACE("%p vert_array:%p nvert:%d grad_array:%p ngrad:%d\n", hdc, vert_array, nvert, grad_array, ngrad);
|
||||
|
||||
if (!vert_array || !nvert || !grad_array || !ngrad || mode > GRADIENT_FILL_TRIANGLE)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
|
@ -938,11 +936,7 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
|
|||
for (i = 0; i < ngrad * (mode == GRADIENT_FILL_TRIANGLE ? 3 : 2); i++)
|
||||
if (((ULONG *)grad_array)[i] >= nvert) return FALSE;
|
||||
|
||||
if (!(dc = get_dc_ptr( hdc )))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
if (!(dc = get_dc_ptr( hdc ))) return FALSE;
|
||||
update_dc( dc );
|
||||
physdev = GET_DC_PHYSDEV( dc, pGradientFill );
|
||||
ret = physdev->funcs->pGradientFill( physdev, vert_array, nvert, grad_array, ngrad, mode );
|
||||
|
|
Loading…
Reference in New Issue