gdi32: Add an option to allow pen_lines to draw a closed figure.
This commit is contained in:
parent
8342d5049f
commit
224e51fcf5
|
@ -87,7 +87,7 @@ typedef struct dibdrv_physdev
|
|||
DWORD pen_color, pen_and, pen_xor;
|
||||
dash_pattern pen_pattern;
|
||||
dash_pos dash_pos;
|
||||
BOOL (* pen_lines)(struct dibdrv_physdev *pdev, int num, POINT *pts);
|
||||
BOOL (* pen_lines)(struct dibdrv_physdev *pdev, int num, POINT *pts, BOOL close);
|
||||
|
||||
/* brush */
|
||||
UINT brush_style;
|
||||
|
|
|
@ -431,7 +431,7 @@ BOOL dibdrv_LineTo( PHYSDEV dev, INT x, INT y )
|
|||
|
||||
reset_dash_origin(pdev);
|
||||
|
||||
if(defer_pen(pdev) || !pdev->pen_lines(pdev, 2, pts))
|
||||
if(defer_pen(pdev) || !pdev->pen_lines(pdev, 2, pts, FALSE))
|
||||
return next->funcs->pLineTo( next, x, y );
|
||||
|
||||
return TRUE;
|
||||
|
@ -528,7 +528,7 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
|
|||
LPtoDP( dev->hdc, points, counts[i] );
|
||||
|
||||
reset_dash_origin( pdev );
|
||||
pdev->pen_lines( pdev, counts[i], points );
|
||||
pdev->pen_lines( pdev, counts[i], points, FALSE );
|
||||
}
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, points );
|
||||
|
@ -553,7 +553,7 @@ BOOL dibdrv_Polyline( PHYSDEV dev, const POINT* pt, INT count )
|
|||
LPtoDP( dev->hdc, points, count );
|
||||
|
||||
reset_dash_origin( pdev );
|
||||
pdev->pen_lines( pdev, count, points );
|
||||
pdev->pen_lines( pdev, count, points, FALSE );
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, points );
|
||||
return TRUE;
|
||||
|
@ -567,7 +567,7 @@ BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
|||
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pRectangle );
|
||||
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
|
||||
RECT rect = get_device_rect( dev->hdc, left, top, right, bottom, TRUE );
|
||||
POINT pts[5];
|
||||
POINT pts[4];
|
||||
|
||||
TRACE("(%p, %d, %d, %d, %d)\n", dev, left, top, right, bottom);
|
||||
|
||||
|
@ -583,9 +583,8 @@ BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
|||
pts[0].y = pts[1].y = rect.top;
|
||||
pts[1].x = pts[2].x = rect.left;
|
||||
pts[2].y = pts[3].y = rect.bottom - 1;
|
||||
pts[4] = pts[0];
|
||||
|
||||
pdev->pen_lines(pdev, 5, pts);
|
||||
pdev->pen_lines(pdev, 4, pts, TRUE);
|
||||
|
||||
/* FIXME: Will need updating when we support wide pens */
|
||||
|
||||
|
|
|
@ -696,7 +696,7 @@ static BOOL solid_pen_line(dibdrv_physdev *pdev, POINT *start, POINT *end)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL solid_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts)
|
||||
static BOOL solid_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -705,6 +705,8 @@ static BOOL solid_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts)
|
|||
if (!solid_pen_line( pdev, pts + i, pts + i + 1 ))
|
||||
return FALSE;
|
||||
|
||||
if (close) return solid_pen_line( pdev, pts + num - 1, pts );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -996,7 +998,7 @@ static BOOL dashed_pen_line(dibdrv_physdev *pdev, POINT *start, POINT *end)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL dashed_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts)
|
||||
static BOOL dashed_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1005,10 +1007,12 @@ static BOOL dashed_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts)
|
|||
if (!dashed_pen_line( pdev, pts + i, pts + i + 1 ))
|
||||
return FALSE;
|
||||
|
||||
if (close) return dashed_pen_line( pdev, pts + num - 1, pts );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL null_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts)
|
||||
static BOOL null_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue