winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
972 discussions
Start a n
N
ew thread
Jörg Höhle : mciseq: Check Device ID prior to command invocation.
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: 39fa94324d8e309d4b7416b9b5c5539376258b0c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=39fa94324d8e309d4b7416b9b…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Dec 15 22:36:01 2010 +0100 mciseq: Check Device ID prior to command invocation. --- dlls/mciseq/mcimidi.c | 128 +++++++++++++++++++------------------------------ 1 files changed, 49 insertions(+), 79 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=39fa94324d8e309d4b741…
1
0
0
0
Jörg Höhle : mciseq: Only send non-MCI commands to DefDriverProc.
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: dc17cec398d8047368ac38d8dd3b748f9e6a7e08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc17cec398d8047368ac38d8d…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Dec 15 21:49:58 2010 +0100 mciseq: Only send non-MCI commands to DefDriverProc. --- dlls/mciseq/mcimidi.c | 31 +++++++------------------------ 1 files changed, 7 insertions(+), 24 deletions(-) diff --git a/dlls/mciseq/mcimidi.c b/dlls/mciseq/mcimidi.c index 6bf7f4d..55f06f8 100644 --- a/dlls/mciseq/mcimidi.c +++ b/dlls/mciseq/mcimidi.c @@ -1630,6 +1630,10 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION; + if ((wMsg < DRV_MCI_FIRST) || (wMsg > DRV_MCI_LAST)) { + TRACE("Sending msg %04x to default driver proc\n", wMsg); + return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); + } switch (wMsg) { case MCI_OPEN_DRIVER: return MIDI_mciOpen (dwDevID, dwParam1, (LPMCI_OPEN_PARMSW) dwParam2); case MCI_CLOSE_DRIVER: return MIDI_mciClose (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); @@ -1642,33 +1646,12 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, case MCI_GETDEVCAPS: return MIDI_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2); case MCI_INFO: return MIDI_mciInfo (dwDevID, dwParam1, (LPMCI_INFO_PARMSW) dwParam2); case MCI_SEEK: return MIDI_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2); - /* commands that should report an error */ - case MCI_RECORD: - case MCI_LOAD: - case MCI_SAVE: - case MCI_FREEZE: - case MCI_PUT: - case MCI_WINDOW: - case MCI_REALIZE: - case MCI_UNFREEZE: - case MCI_UPDATE: - case MCI_WHERE: - case MCI_STEP: - case MCI_SPIN: - case MCI_ESCAPE: - case MCI_COPY: - case MCI_CUT: - case MCI_DELETE: - case MCI_PASTE: - TRACE("Unsupported command [0x%x]\n", wMsg); - break; case MCI_OPEN: case MCI_CLOSE: FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n"); - break; + /* fall through */ default: - TRACE("Sending msg [%u] to default driver proc\n", wMsg); - return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); + TRACE("Unsupported command [0x%x]\n", wMsg); + return MCIERR_UNSUPPORTED_FUNCTION; /* Win9x: MCIERR_UNRECOGNIZED_COMMAND */ } - return MCIERR_UNSUPPORTED_FUNCTION; }
1
0
0
0
André Hentschel : usp10: Check for pointer before using it (Coverity).
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: d845510170d41b7da901e6d9aaf52a91c76e394f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d845510170d41b7da901e6d9a…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Tue Jan 3 03:33:23 2012 +0100 usp10: Check for pointer before using it (Coverity). --- dlls/usp10/usp10.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 9ddff1b..1f6ec53 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -2737,7 +2737,7 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc, ((ScriptCache *)*psc)->userLang = tagLangSys; /* set fNoGlyphIndex non truetype/opentype fonts */ - if (!psa->fNoGlyphIndex && !((ScriptCache *)*psc)->sfnt) + if (psa && !psa->fNoGlyphIndex && !((ScriptCache *)*psc)->sfnt) psa->fNoGlyphIndex = TRUE; /* Initialize a SCRIPT_VISATTR and LogClust for each char in this run */
1
0
0
0
Alexandre Julliard : gdi32/tests: Add some tests for brushed and dashed wide pens.
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: 4b524f91e2f96b2eb4a275ce071bc367309ff9bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4b524f91e2f96b2eb4a275ce0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 4 18:17:05 2012 +0100 gdi32/tests: Add some tests for brushed and dashed wide pens. --- dlls/gdi32/tests/dib.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 111 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4b524f91e2f96b2eb4a27…
1
0
0
0
Alexandre Julliard : gdi32: Get rid of the pen deferring support, all pen styles are implemented now.
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: d858041a1960789701ca09cbc2cc41d3fc85d5a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d858041a1960789701ca09cbc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 4 16:53:17 2012 +0100 gdi32: Get rid of the pen deferring support, all pen styles are implemented now. --- dlls/gdi32/dibdrv/dc.c | 1 - dlls/gdi32/dibdrv/dibdrv.h | 8 -------- dlls/gdi32/dibdrv/graphics.c | 13 ------------- dlls/gdi32/dibdrv/objects.c | 8 -------- 4 files changed, 0 insertions(+), 30 deletions(-) diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 5b9c844..97771c5 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -363,7 +363,6 @@ static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap ) return 0; } pdev->dib = dib; - pdev->defer = 0; GDI_ReleaseObj( bitmap ); return next->funcs->pSelectBitmap( next, bitmap ); diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h index 03d48af..5d93578 100644 --- a/dlls/gdi32/dibdrv/dibdrv.h +++ b/dlls/gdi32/dibdrv/dibdrv.h @@ -96,7 +96,6 @@ typedef struct dibdrv_physdev dib_brush brush; HRGN clip; - DWORD defer; /* pen */ DWORD pen_style, pen_endcap, pen_join; @@ -109,8 +108,6 @@ typedef struct dibdrv_physdev BOOL (* pen_lines)(struct dibdrv_physdev *pdev, int num, POINT *pts, BOOL close, HRGN region); } dibdrv_physdev; -#define DEFER_PEN 2 - extern BOOL dibdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst, 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, @@ -261,8 +258,3 @@ static inline int edge_coord( int y, int x1, int y1, int x2, int y2 ) else return x1 + (y - y1) * (x2 - x1) / (y2 - y1); } - -static inline BOOL defer_pen(dibdrv_physdev *pdev) -{ - return pdev->defer & DEFER_PEN; -} diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c index d14148e..1ba157b 100644 --- a/dlls/gdi32/dibdrv/graphics.c +++ b/dlls/gdi32/dibdrv/graphics.c @@ -441,14 +441,11 @@ COLORREF dibdrv_GetPixel( 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); POINT pts[2]; HRGN region = 0; BOOL ret; - if(defer_pen(pdev)) return next->funcs->pLineTo( next, x, y ); - GetCurrentPositionEx(dev->hdc, pts); pts[1].x = x; pts[1].y = y; @@ -525,14 +522,11 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn ) BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD polygons ) { dibdrv_physdev *pdev = get_dibdrv_pdev(dev); - PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyPolygon ); DWORD total, i, pos; BOOL ret = TRUE; POINT *points; HRGN outline = 0, interior = 0; - if (defer_pen( pdev )) return next->funcs->pPolyPolygon( next, pt, counts, polygons ); - for (i = total = 0; i < polygons; i++) { if (counts[i] < 2) return FALSE; @@ -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 ) { dibdrv_physdev *pdev = get_dibdrv_pdev(dev); - PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyPolyline ); DWORD max_points = 0, i; POINT *points; BOOL ret = TRUE; HRGN outline = 0; - if (defer_pen( pdev )) return next->funcs->pPolyPolyline( next, pt, counts, polylines ); - for (i = 0; i < polylines; i++) { if (counts[i] < 2) return FALSE; @@ -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 ) { - 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[4]; @@ -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(defer_pen(pdev)) - return next->funcs->pRectangle( next, left, top, right, bottom ); - if (pdev->pen_style == PS_INSIDEFRAME) { rect.left += pdev->pen_width / 2; diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index 51a49cc..e18d715 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -2088,8 +2088,6 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte set_dash_pattern( &pdev->pen_pattern, 0, NULL ); select_brush( &pdev->pen_brush, &logbrush, pattern ); - pdev->defer |= DEFER_PEN; - pdev->pen_style = logpen.lopnStyle & PS_STYLE_MASK; switch (pdev->pen_style) @@ -2107,40 +2105,34 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte pdev->pen_lines = dashed_wide_pen_lines; } else pdev->pen_lines = dashed_pen_lines; - pdev->defer &= ~DEFER_PEN; break; } if (pdev->pen_width == 1) /* wide cosmetic pens are not dashed */ { pdev->pen_lines = dashed_pen_lines; pdev->pen_pattern = dash_patterns_cosmetic[pdev->pen_style - 1]; - pdev->defer &= ~DEFER_PEN; break; } /* fall through */ case PS_SOLID: case PS_INSIDEFRAME: pdev->pen_lines = (pdev->pen_width == 1) ? solid_pen_lines : wide_pen_lines; - pdev->defer &= ~DEFER_PEN; break; case PS_NULL: pdev->pen_width = 0; pdev->pen_lines = null_pen_lines; - pdev->defer &= ~DEFER_PEN; break; case PS_ALTERNATE: pdev->pen_lines = dashed_pen_lines; pdev->pen_pattern = dash_patterns_geometric[PS_DOT - 1]; - pdev->defer &= ~DEFER_PEN; break; case PS_USERSTYLE: pdev->pen_lines = (pdev->pen_width == 1) ? dashed_pen_lines : dashed_wide_pen_lines; 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 ); - pdev->defer &= ~DEFER_PEN; break; }
1
0
0
0
Alexandre Julliard : gdi32: Implement dashed wide lines.
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: c82d2a034f918a297915e39784ddfe949b37919c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c82d2a034f918a297915e3978…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 4 15:05:00 2012 +0100 gdi32: Implement dashed wide lines. --- dlls/gdi32/dibdrv/objects.c | 144 +++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 138 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index 6933346..51a49cc 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -1523,6 +1523,125 @@ static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close return TRUE; } +static BOOL dashed_wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close, HRGN total) +{ + int i, start, cur_len, initial_num = 0; + POINT initial_point, start_point, end_point; + HRGN round_cap = 0; + + assert( total != 0 ); /* wide pens should always be drawn through a region */ + assert( num >= 2 ); + + /* skip empty segments */ + while (num > 2 && pts[0].x == pts[1].x && pts[0].y == pts[1].y) { pts++; num--; } + while (num > 2 && pts[num - 1].x == pts[num - 2].x && pts[num - 1].y == pts[num - 2].y) num--; + + if (pdev->pen_join == PS_JOIN_ROUND || pdev->pen_endcap == PS_ENDCAP_ROUND) + round_cap = CreateEllipticRgn( -(pdev->pen_width / 2), -(pdev->pen_width / 2), + (pdev->pen_width + 1) / 2, (pdev->pen_width + 1) / 2 ); + + start = 0; + cur_len = 0; + start_point = pts[0]; + + for (i = 0; i < (close ? num : num - 1); i++) + { + const POINT *pt_1 = pts + i; + const POINT *pt_2 = pts + ((close && i == num - 1) ? 0 : i + 1); + int dx = pt_2->x - pt_1->x; + int dy = pt_2->y - pt_1->y; + + if (dx == 0 && dy == 0) continue; + + if (dy == 0) + { + if (abs( dx ) - cur_len < pdev->dash_pos.left_in_dash) + { + skip_dash( pdev, abs( dx ) - cur_len ); + cur_len = 0; + continue; + } + cur_len += pdev->dash_pos.left_in_dash; + dx = (dx > 0) ? cur_len : -cur_len; + } + else if (dx == 0) + { + if (abs( dy ) - cur_len < pdev->dash_pos.left_in_dash) + { + skip_dash( pdev, abs( dy ) - cur_len ); + cur_len = 0; + continue; + } + cur_len += pdev->dash_pos.left_in_dash; + dy = (dy > 0) ? cur_len : -cur_len; + } + else + { + double len = hypot( dx, dy ); + + if (len - cur_len < pdev->dash_pos.left_in_dash) + { + skip_dash( pdev, len - cur_len ); + cur_len = 0; + continue; + } + cur_len += pdev->dash_pos.left_in_dash; + dx = dx * cur_len / len; + dy = dy * cur_len / len; + } + end_point.x = pt_1->x + dx; + end_point.y = pt_1->y + dy; + + if (pdev->dash_pos.mark) + { + if (!initial_num && close) /* this is the first dash, save it for later */ + { + initial_num = i - start + 1; + initial_point = end_point; + } + else wide_line_segments( pdev, num, pts, FALSE, start, i - start + 1, + &start_point, &end_point, round_cap, total ); + } + if (!initial_num) initial_num = -1; /* no need to close it */ + + skip_dash( pdev, pdev->dash_pos.left_in_dash ); + start_point = end_point; + start = i; + i--; /* go on with the same segment */ + } + + if (pdev->dash_pos.mark) /* we have a final dash */ + { + int count; + + if (initial_num > 0) + { + count = num - start + initial_num; + end_point = initial_point; + } + else if (close) + { + count = num - start; + end_point = pts[0]; + } + else + { + count = num - start - 1; + end_point = pts[num - 1]; + } + wide_line_segments( pdev, num, pts, FALSE, start, count, + &start_point, &end_point, round_cap, total ); + } + else if (initial_num > 0) /* initial dash only */ + { + wide_line_segments( pdev, num, pts, FALSE, 0, initial_num, + &pts[0], &initial_point, round_cap, total ); + } + + if (round_cap) DeleteObject( round_cap ); + return TRUE; +} + static const dash_pattern dash_patterns_cosmetic[4] = { {2, {18, 6}, 24}, /* PS_DASH */ @@ -1550,11 +1669,21 @@ static inline void set_dash_pattern( dash_pattern *pattern, DWORD count, DWORD * if (pattern->count % 2) pattern->total_len *= 2; } -static inline void scale_dash_pattern( dash_pattern *pattern, DWORD scale ) +static inline void scale_dash_pattern( dash_pattern *pattern, DWORD scale, DWORD endcap ) { DWORD i; + for (i = 0; i < pattern->count; i++) pattern->dashes[i] *= scale; pattern->total_len *= scale; + + if (endcap != PS_ENDCAP_FLAT) /* shrink the dashes to leave room for the caps */ + { + for (i = 0; i < pattern->count; i += 2) + { + pattern->dashes[i] -= scale; + pattern->dashes[i + 1] += scale; + } + } } static inline int get_pen_device_width( dibdrv_physdev *pdev, int width ) @@ -1971,9 +2100,13 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte case PS_DASHDOTDOT: if (logpen.lopnStyle & PS_GEOMETRIC) { - if (pdev->pen_width > 1) break; /* not supported yet */ - pdev->pen_lines = dashed_pen_lines; pdev->pen_pattern = dash_patterns_geometric[pdev->pen_style - 1]; + if (pdev->pen_width > 1) + { + scale_dash_pattern( &pdev->pen_pattern, pdev->pen_width, pdev->pen_endcap ); + pdev->pen_lines = dashed_wide_pen_lines; + } + else pdev->pen_lines = dashed_pen_lines; pdev->defer &= ~DEFER_PEN; break; } @@ -2004,10 +2137,9 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte break; case PS_USERSTYLE: - if (pdev->pen_width > 1) break; /* not supported yet */ - pdev->pen_lines = dashed_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 ); - if (!(logpen.lopnStyle & PS_GEOMETRIC)) scale_dash_pattern( &pdev->pen_pattern, 3 ); + if (!(logpen.lopnStyle & PS_GEOMETRIC)) scale_dash_pattern( &pdev->pen_pattern, 3, PS_ENDCAP_FLAT ); pdev->defer &= ~DEFER_PEN; break; }
1
0
0
0
Alexandre Julliard : gdi32: Add a helper function for drawing multiple line segments.
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: bc5428600b97b1d1cf6e7481e9d346a01b07f3e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bc5428600b97b1d1cf6e7481e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 4 16:06:01 2012 +0100 gdi32: Add a helper function for drawing multiple line segments. --- dlls/gdi32/dibdrv/objects.c | 75 +++++++++++++++++++++++++++++-------------- 1 files changed, 51 insertions(+), 24 deletions(-) diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index f04147c..6933346 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -1452,9 +1452,55 @@ static void wide_line_segment( dibdrv_physdev *pdev, HRGN total, face_1->dy = face_2->dy = dy; } -static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close, HRGN total) +static void wide_line_segments( dibdrv_physdev *pdev, int num, const POINT *pts, BOOL close, + int start, int count, const POINT *first_pt, const POINT *last_pt, + HRGN round_cap, HRGN total ) { int i; + struct face face_1, face_2, prev_face, first_face; + const POINT *pt_1, *pt_2; + + if (!close) + { + add_cap( pdev, total, round_cap, first_pt ); + add_cap( pdev, total, round_cap, last_pt ); + } + + if (count == 1) + { + pt_1 = &pts[start]; + pt_2 = &pts[(start + 1) % num]; + wide_line_segment( pdev, total, first_pt, last_pt, pt_2->x - pt_1->x, pt_2->y - pt_1->y, + TRUE, TRUE, &face_1, &face_2 ); + return; + } + + pt_1 = &pts[start]; + pt_2 = &pts[(start + 1) % num]; + wide_line_segment( pdev, total, first_pt, pt_2, pt_2->x - pt_1->x, pt_2->y - pt_1->y, + !close, FALSE, &first_face, &prev_face ); + + + for (i = 1; i < count - 1; i++) + { + pt_1 = &pts[(start + i) % num]; + pt_2 = &pts[(start + i + 1) % num]; + wide_line_segment( pdev, total, pt_1, pt_2, pt_2->x - pt_1->x, pt_2->y - pt_1->y, + FALSE, FALSE, &face_1, &face_2 ); + add_join( pdev, total, round_cap, pt_1, &prev_face, &face_1 ); + prev_face = face_2; + } + + pt_1 = &pts[(start + count - 1) % num]; + pt_2 = &pts[(start + count) % num]; + wide_line_segment( pdev, total, pt_1, last_pt, pt_2->x - pt_1->x, pt_2->y - pt_1->y, + FALSE, !close, &face_1, &face_2 ); + add_join( pdev, total, round_cap, pt_1, &prev_face, &face_1 ); + if (close) add_join( pdev, total, round_cap, last_pt, &face_2, &first_face ); +} + +static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close, HRGN total) +{ HRGN round_cap = 0; assert( total != 0 ); /* wide pens should always be drawn through a region */ @@ -1468,30 +1514,11 @@ static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close round_cap = CreateEllipticRgn( -(pdev->pen_width / 2), -(pdev->pen_width / 2), (pdev->pen_width + 1) / 2, (pdev->pen_width + 1) / 2 ); - if (!close) num--; - for (i = 0; i < num; i++) - { - const POINT *pt_1 = pts + i; - const POINT *pt_2 = pts + ((close && i == num - 1) ? 0 : i + 1); - int dx = pt_2->x - pt_1->x; - int dy = pt_2->y - pt_1->y; - struct face face_1, face_2, prev_face, first_face; - BOOL need_cap_1 = !close && (i == 0); - BOOL need_cap_2 = !close && (i == num - 1); - - wide_line_segment( pdev, total, pt_1, pt_2, dx, dy, need_cap_1, need_cap_2, &face_1, &face_2 ); - - if (need_cap_1) add_cap( pdev, total, round_cap, pt_1 ); - if (need_cap_2) add_cap( pdev, total, round_cap, pt_2 ); - - if (i == 0) first_face = face_1; - else add_join( pdev, total, round_cap, pt_1, &prev_face, &face_1 ); - - if (i == num - 1 && close) - add_join( pdev, total, round_cap, pt_2, &face_2, &first_face ); + if (close) + wide_line_segments( pdev, num, pts, TRUE, 0, num, &pts[0], &pts[0], round_cap, total ); + else + wide_line_segments( pdev, num, pts, FALSE, 0, num - 1, &pts[0], &pts[num - 1], round_cap, total ); - prev_face = face_2; - } if (round_cap) DeleteObject( round_cap ); return TRUE; }
1
0
0
0
Alexandre Julliard : gdi32: Add a helper function for drawing a wide line segment.
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: a59c53b312926e5bf1361039e8d79424ffa6d2ab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a59c53b312926e5bf1361039e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 4 15:50:31 2012 +0100 gdi32: Add a helper function for drawing a wide line segment. --- dlls/gdi32/dibdrv/objects.c | 246 ++++++++++++++++++++++--------------------- 1 files changed, 127 insertions(+), 119 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a59c53b312926e5bf1361…
1
0
0
0
Alexandre Julliard : gdi32: Skip empty segments at the beginning and end of a line to make sure the caps are correct .
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: 8b1bab524b4cfe72a6d7eebbe2698626d456ca7b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b1bab524b4cfe72a6d7eebbe…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 4 15:10:10 2012 +0100 gdi32: Skip empty segments at the beginning and end of a line to make sure the caps are correct. --- dlls/gdi32/dibdrv/objects.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index 879d920..9f4f035 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -1334,6 +1334,10 @@ static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close assert( total != 0 ); /* wide pens should always be drawn through a region */ assert( num >= 2 ); + /* skip empty segments */ + while (num > 2 && pts[0].x == pts[1].x && pts[0].y == pts[1].y) { pts++; num--; } + while (num > 2 && pts[num - 1].x == pts[num - 2].x && pts[num - 1].y == pts[num - 2].y) num--; + if (pdev->pen_join == PS_JOIN_ROUND || pdev->pen_endcap == PS_ENDCAP_ROUND) round_cap = CreateEllipticRgn( -(pdev->pen_width / 2), -(pdev->pen_width / 2), (pdev->pen_width + 1) / 2, (pdev->pen_width + 1) / 2 );
1
0
0
0
Alexandre Julliard : gdi32: Only create the round cap region once per call.
by Alexandre Julliard
04 Jan '12
04 Jan '12
Module: wine Branch: master Commit: 5f2371c229372951eb758476e703cbd3b6ec06a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f2371c229372951eb758476e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 4 14:59:01 2012 +0100 gdi32: Only create the round cap region once per call. --- dlls/gdi32/dibdrv/objects.c | 49 ++++++++++++++++++++++--------------------- 1 files changed, 25 insertions(+), 24 deletions(-) diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index ee58192..879d920 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -1214,27 +1214,22 @@ struct face int dx, dy; }; -static void add_cap( dibdrv_physdev *pdev, HRGN region, const POINT *pt ) +static void add_cap( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const POINT *pt ) { - HRGN cap; - switch (pdev->pen_endcap) { default: FIXME( "Unknown end cap %x\n", pdev->pen_endcap ); /* fall through */ case PS_ENDCAP_ROUND: - cap = CreateEllipticRgn( pt->x - pdev->pen_width / 2, pt->y - pdev->pen_width / 2, - pt->x + (pdev->pen_width + 1) / 2, pt->y + (pdev->pen_width + 1) / 2 ); - break; + OffsetRgn( round_cap, pt->x, pt->y ); + CombineRgn( region, region, round_cap, RGN_OR ); + OffsetRgn( round_cap, -pt->x, -pt->y ); + return; case PS_ENDCAP_SQUARE: /* already been handled */ case PS_ENDCAP_FLAT: return; } - - CombineRgn( region, region, cap, RGN_OR ); - DeleteObject( cap ); - return; } #define round( f ) (((f) > 0) ? (f) + 0.5 : (f) - 0.5) @@ -1297,7 +1292,7 @@ static HRGN create_miter_region( dibdrv_physdev *pdev, const POINT *pt, return CreatePolygonRgn( pts, 5, ALTERNATE ); } -static void add_join( dibdrv_physdev *pdev, HRGN region, const POINT *pt, +static void add_join( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const POINT *pt, const struct face *face_1, const struct face *face_2 ) { HRGN join; @@ -1308,9 +1303,10 @@ static void add_join( dibdrv_physdev *pdev, HRGN region, const POINT *pt, default: FIXME( "Unknown line join %x\n", pdev->pen_join ); /* fall through */ case PS_JOIN_ROUND: - join = CreateEllipticRgn( pt->x - pdev->pen_width / 2, pt->y - pdev->pen_width / 2, - pt->x + (pdev->pen_width + 1) / 2, pt->y + (pdev->pen_width + 1) / 2 ); - break; + OffsetRgn( round_cap, pt->x, pt->y ); + CombineRgn( region, region, round_cap, RGN_OR ); + OffsetRgn( round_cap, -pt->x, -pt->y ); + return; case PS_JOIN_MITER: join = create_miter_region( pdev, pt, face_1, face_2 ); @@ -1333,11 +1329,15 @@ static void add_join( dibdrv_physdev *pdev, HRGN region, const POINT *pt, static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close, HRGN total) { int i; - HRGN segment; + HRGN round_cap = 0; assert( total != 0 ); /* wide pens should always be drawn through a region */ assert( num >= 2 ); + if (pdev->pen_join == PS_JOIN_ROUND || pdev->pen_endcap == PS_ENDCAP_ROUND) + round_cap = CreateEllipticRgn( -(pdev->pen_width / 2), -(pdev->pen_width / 2), + (pdev->pen_width + 1) / 2, (pdev->pen_width + 1) / 2 ); + if (!close) num--; for (i = 0; i < num; i++) { @@ -1362,7 +1362,7 @@ static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close rect.bottom = rect.top + pdev->pen_width; if ((sq_cap_1 && dx > 0) || (sq_cap_2 && dx < 0)) rect.left -= pdev->pen_width / 2; if ((sq_cap_2 && dx > 0) || (sq_cap_1 && dx < 0)) rect.right += pdev->pen_width / 2; - segment = CreateRectRgnIndirect( &rect ); + add_rect_to_region( total, &rect ); if (dx > 0) { face_1.start.x = face_1.end.x = rect.left; @@ -1386,7 +1386,7 @@ static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close rect.right = rect.left + pdev->pen_width; if ((sq_cap_1 && dy > 0) || (sq_cap_2 && dy < 0)) rect.top -= pdev->pen_width / 2; if ((sq_cap_2 && dy > 0) || (sq_cap_1 && dy < 0)) rect.bottom += pdev->pen_width / 2; - segment = CreateRectRgnIndirect( &rect ); + add_rect_to_region( total, &rect ); if (dy > 0) { face_1.start.x = face_2.end.x = rect.left; @@ -1408,6 +1408,7 @@ static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close double width_x, width_y; POINT seg_pts[4]; POINT wide_half, narrow_half; + HRGN segment; width_x = pdev->pen_width * abs( dy ) / len; width_y = pdev->pen_width * abs( dx ) / len; @@ -1456,6 +1457,8 @@ static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close } segment = CreatePolygonRgn( seg_pts, 4, ALTERNATE ); + CombineRgn( total, total, segment, RGN_OR ); + DeleteObject( segment ); face_1.start = seg_pts[0]; face_1.end = seg_pts[1]; @@ -1463,23 +1466,21 @@ static BOOL wide_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL close face_2.end = seg_pts[3]; } - CombineRgn( total, total, segment, RGN_OR ); - DeleteObject( segment ); - - if (need_cap_1) add_cap( pdev, total, pt_1 ); - if (need_cap_2) add_cap( pdev, total, pt_2 ); + if (need_cap_1) add_cap( pdev, total, round_cap, pt_1 ); + if (need_cap_2) add_cap( pdev, total, round_cap, pt_2 ); face_1.dx = face_2.dx = dx; face_1.dy = face_2.dy = dy; if (i == 0) first_face = face_1; - else add_join( pdev, total, pt_1, &prev_face, &face_1 ); + else add_join( pdev, total, round_cap, pt_1, &prev_face, &face_1 ); if (i == num - 1 && close) - add_join( pdev, total, pt_2, &face_2, &first_face ); + add_join( pdev, total, round_cap, pt_2, &face_2, &first_face ); prev_face = face_2; } + if (round_cap) DeleteObject( round_cap ); return TRUE; }
1
0
0
0
← Newer
1
...
86
87
88
89
90
91
92
...
98
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Results per page:
10
25
50
100
200