Commit d858041a authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Get rid of the pen deferring support, all pen styles are implemented now.

parent c82d2a03
...@@ -363,7 +363,6 @@ static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap ) ...@@ -363,7 +363,6 @@ static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
return 0; return 0;
} }
pdev->dib = dib; pdev->dib = dib;
pdev->defer = 0;
GDI_ReleaseObj( bitmap ); GDI_ReleaseObj( bitmap );
return next->funcs->pSelectBitmap( next, bitmap ); return next->funcs->pSelectBitmap( next, bitmap );
......
...@@ -96,7 +96,6 @@ typedef struct dibdrv_physdev ...@@ -96,7 +96,6 @@ typedef struct dibdrv_physdev
dib_brush brush; dib_brush brush;
HRGN clip; HRGN clip;
DWORD defer;
/* pen */ /* pen */
DWORD pen_style, pen_endcap, pen_join; DWORD pen_style, pen_endcap, pen_join;
...@@ -109,8 +108,6 @@ typedef struct dibdrv_physdev ...@@ -109,8 +108,6 @@ typedef struct dibdrv_physdev
BOOL (* pen_lines)(struct dibdrv_physdev *pdev, int num, POINT *pts, BOOL close, HRGN region); BOOL (* pen_lines)(struct dibdrv_physdev *pdev, int num, POINT *pts, BOOL close, HRGN region);
} dibdrv_physdev; } dibdrv_physdev;
#define DEFER_PEN 2
extern BOOL dibdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst, extern BOOL dibdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
PHYSDEV src_dev, struct bitblt_coords *src, BLENDFUNCTION blend ) DECLSPEC_HIDDEN; PHYSDEV src_dev, struct bitblt_coords *src, BLENDFUNCTION blend ) DECLSPEC_HIDDEN;
extern DWORD dibdrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct gdi_image_bits *bits, extern DWORD dibdrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct gdi_image_bits *bits,
...@@ -261,8 +258,3 @@ static inline int edge_coord( int y, int x1, int y1, int x2, int y2 ) ...@@ -261,8 +258,3 @@ static inline int edge_coord( int y, int x1, int y1, int x2, int y2 )
else else
return x1 + (y - y1) * (x2 - x1) / (y2 - y1); return x1 + (y - y1) * (x2 - x1) / (y2 - y1);
} }
static inline BOOL defer_pen(dibdrv_physdev *pdev)
{
return pdev->defer & DEFER_PEN;
}
...@@ -441,14 +441,11 @@ COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y ) ...@@ -441,14 +441,11 @@ COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y )
*/ */
BOOL dibdrv_LineTo( PHYSDEV dev, INT x, INT y ) BOOL dibdrv_LineTo( PHYSDEV dev, INT x, INT y )
{ {
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pLineTo );
dibdrv_physdev *pdev = get_dibdrv_pdev(dev); dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
POINT pts[2]; POINT pts[2];
HRGN region = 0; HRGN region = 0;
BOOL ret; BOOL ret;
if(defer_pen(pdev)) return next->funcs->pLineTo( next, x, y );
GetCurrentPositionEx(dev->hdc, pts); GetCurrentPositionEx(dev->hdc, pts);
pts[1].x = x; pts[1].x = x;
pts[1].y = y; pts[1].y = y;
...@@ -525,14 +522,11 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn ) ...@@ -525,14 +522,11 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn )
BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD polygons ) BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD polygons )
{ {
dibdrv_physdev *pdev = get_dibdrv_pdev(dev); dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyPolygon );
DWORD total, i, pos; DWORD total, i, pos;
BOOL ret = TRUE; BOOL ret = TRUE;
POINT *points; POINT *points;
HRGN outline = 0, interior = 0; HRGN outline = 0, interior = 0;
if (defer_pen( pdev )) return next->funcs->pPolyPolygon( next, pt, counts, polygons );
for (i = total = 0; i < polygons; i++) for (i = total = 0; i < polygons; i++)
{ {
if (counts[i] < 2) return FALSE; if (counts[i] < 2) return FALSE;
...@@ -589,14 +583,11 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD ...@@ -589,14 +583,11 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD
BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polylines ) BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polylines )
{ {
dibdrv_physdev *pdev = get_dibdrv_pdev(dev); dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyPolyline );
DWORD max_points = 0, i; DWORD max_points = 0, i;
POINT *points; POINT *points;
BOOL ret = TRUE; BOOL ret = TRUE;
HRGN outline = 0; HRGN outline = 0;
if (defer_pen( pdev )) return next->funcs->pPolyPolyline( next, pt, counts, polylines );
for (i = 0; i < polylines; i++) for (i = 0; i < polylines; i++)
{ {
if (counts[i] < 2) return FALSE; if (counts[i] < 2) return FALSE;
...@@ -659,7 +650,6 @@ BOOL dibdrv_Polyline( PHYSDEV dev, const POINT* pt, INT count ) ...@@ -659,7 +650,6 @@ BOOL dibdrv_Polyline( PHYSDEV dev, const POINT* pt, INT count )
*/ */
BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) 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); dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
RECT rect = get_device_rect( dev->hdc, left, top, right, bottom, TRUE ); RECT rect = get_device_rect( dev->hdc, left, top, right, bottom, TRUE );
POINT pts[4]; POINT pts[4];
...@@ -670,9 +660,6 @@ BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) ...@@ -670,9 +660,6 @@ BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
if(rect.left == rect.right || rect.top == rect.bottom) return TRUE; if(rect.left == rect.right || rect.top == rect.bottom) return TRUE;
if(defer_pen(pdev))
return next->funcs->pRectangle( next, left, top, right, bottom );
if (pdev->pen_style == PS_INSIDEFRAME) if (pdev->pen_style == PS_INSIDEFRAME)
{ {
rect.left += pdev->pen_width / 2; rect.left += pdev->pen_width / 2;
......
...@@ -2088,8 +2088,6 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte ...@@ -2088,8 +2088,6 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte
set_dash_pattern( &pdev->pen_pattern, 0, NULL ); set_dash_pattern( &pdev->pen_pattern, 0, NULL );
select_brush( &pdev->pen_brush, &logbrush, pattern ); select_brush( &pdev->pen_brush, &logbrush, pattern );
pdev->defer |= DEFER_PEN;
pdev->pen_style = logpen.lopnStyle & PS_STYLE_MASK; pdev->pen_style = logpen.lopnStyle & PS_STYLE_MASK;
switch (pdev->pen_style) switch (pdev->pen_style)
...@@ -2107,40 +2105,34 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte ...@@ -2107,40 +2105,34 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte
pdev->pen_lines = dashed_wide_pen_lines; pdev->pen_lines = dashed_wide_pen_lines;
} }
else pdev->pen_lines = dashed_pen_lines; else pdev->pen_lines = dashed_pen_lines;
pdev->defer &= ~DEFER_PEN;
break; break;
} }
if (pdev->pen_width == 1) /* wide cosmetic pens are not dashed */ if (pdev->pen_width == 1) /* wide cosmetic pens are not dashed */
{ {
pdev->pen_lines = dashed_pen_lines; pdev->pen_lines = dashed_pen_lines;
pdev->pen_pattern = dash_patterns_cosmetic[pdev->pen_style - 1]; pdev->pen_pattern = dash_patterns_cosmetic[pdev->pen_style - 1];
pdev->defer &= ~DEFER_PEN;
break; break;
} }
/* fall through */ /* fall through */
case PS_SOLID: case PS_SOLID:
case PS_INSIDEFRAME: case PS_INSIDEFRAME:
pdev->pen_lines = (pdev->pen_width == 1) ? solid_pen_lines : wide_pen_lines; pdev->pen_lines = (pdev->pen_width == 1) ? solid_pen_lines : wide_pen_lines;
pdev->defer &= ~DEFER_PEN;
break; break;
case PS_NULL: case PS_NULL:
pdev->pen_width = 0; pdev->pen_width = 0;
pdev->pen_lines = null_pen_lines; pdev->pen_lines = null_pen_lines;
pdev->defer &= ~DEFER_PEN;
break; break;
case PS_ALTERNATE: case PS_ALTERNATE:
pdev->pen_lines = dashed_pen_lines; pdev->pen_lines = dashed_pen_lines;
pdev->pen_pattern = dash_patterns_geometric[PS_DOT - 1]; pdev->pen_pattern = dash_patterns_geometric[PS_DOT - 1];
pdev->defer &= ~DEFER_PEN;
break; break;
case PS_USERSTYLE: case PS_USERSTYLE:
pdev->pen_lines = (pdev->pen_width == 1) ? dashed_pen_lines : dashed_wide_pen_lines; pdev->pen_lines = (pdev->pen_width == 1) ? dashed_pen_lines : dashed_wide_pen_lines;
set_dash_pattern( &pdev->pen_pattern, elp->elpNumEntries, elp->elpStyleEntry ); set_dash_pattern( &pdev->pen_pattern, elp->elpNumEntries, elp->elpStyleEntry );
if (!(logpen.lopnStyle & PS_GEOMETRIC)) scale_dash_pattern( &pdev->pen_pattern, 3, PS_ENDCAP_FLAT ); if (!(logpen.lopnStyle & PS_GEOMETRIC)) scale_dash_pattern( &pdev->pen_pattern, 3, PS_ENDCAP_FLAT );
pdev->defer &= ~DEFER_PEN;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment