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
February 2013
----- 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
459 discussions
Start a n
N
ew thread
Dmitry Timoshkov : gdiplus: Slightly simplify GdipFillClosedCurve2 implementation.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: bb16c926b416e83244901a5e4bf7d0acc67bd88f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bb16c926b416e83244901a5e4…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:45 2013 +0800 gdiplus: Slightly simplify GdipFillClosedCurve2 implementation. --- dlls/gdiplus/graphics.c | 24 +++++++----------------- 1 files changed, 7 insertions(+), 17 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 32102a6..ffb36bb 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3486,7 +3486,7 @@ GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, REAL tension, GpFillMode fill) { GpPath *path; - GpStatus stat; + GpStatus status; TRACE("(%p, %p, %p, %d, %.2f, %d)\n", graphics, brush, points, count, tension, fill); @@ -3500,25 +3500,15 @@ GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush, if(count == 1) /* Do nothing */ return Ok; - stat = GdipCreatePath(fill, &path); - if(stat != Ok) - return stat; - - stat = GdipAddPathClosedCurve2(path, points, count, tension); - if(stat != Ok){ - GdipDeletePath(path); - return stat; - } + status = GdipCreatePath(fill, &path); + if (status != Ok) return status; - stat = GdipFillPath(graphics, brush, path); - if(stat != Ok){ - GdipDeletePath(path); - return stat; - } + status = GdipAddPathClosedCurve2(path, points, count, tension); + if (status == Ok) + status = GdipFillPath(graphics, brush, path); GdipDeletePath(path); - - return Ok; + return status; } GpStatus WINGDIPAPI GdipFillClosedCurve2I(GpGraphics *graphics, GpBrush *brush,
1
0
0
0
Dmitry Timoshkov : gdiplus: Reimplement GdipDrawRectangles using GdipDrawPath.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: 338958287a9aae8d4b6e6a26f077f9706ffc7b0c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=338958287a9aae8d4b6e6a26f…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:39 2013 +0800 gdiplus: Reimplement GdipDrawRectangles using GdipDrawPath. --- dlls/gdiplus/graphics.c | 46 +++++++++------------------------------------- 1 files changed, 9 insertions(+), 37 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 39c2b0f..32102a6 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3431,9 +3431,8 @@ GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x, GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF* rects, INT count) { - GpPointF *ptf; - POINT *pti; - INT save_state, i; + GpStatus status; + GpPath *path; TRACE("(%p, %p, %p, %d)\n", graphics, pen, rects, count); @@ -3443,42 +3442,15 @@ GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, if(graphics->busy) return ObjectBusy; - if (!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - - ptf = GdipAlloc(4 * count * sizeof(GpPointF)); - pti = GdipAlloc(4 * count * sizeof(POINT)); - - if(!ptf || !pti){ - GdipFree(ptf); - GdipFree(pti); - return OutOfMemory; - } - - for(i = 0; i < count; i++){ - ptf[4 * i + 3].X = ptf[4 * i].X = rects[i].X; - ptf[4 * i + 1].Y = ptf[4 * i].Y = rects[i].Y; - ptf[4 * i + 2].X = ptf[4 * i + 1].X = rects[i].X + rects[i].Width; - ptf[4 * i + 3].Y = ptf[4 * i + 2].Y = rects[i].Y + rects[i].Height; - } - - save_state = prepare_dc(graphics, pen); - SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH)); - - transform_and_round_points(graphics, pti, ptf, 4 * count); - - for(i = 0; i < count; i++) - Polygon(graphics->hdc, &pti[4 * i], 4); - - restore_dc(graphics, save_state); + status = GdipCreatePath(FillModeAlternate, &path); + if (status != Ok) return status; - GdipFree(ptf); - GdipFree(pti); + status = GdipAddPathRectangles(path, rects, count); + if (status == Ok) + status = GdipDrawPath(graphics, pen, path); - return Ok; + GdipDeletePath(path); + return status; } GpStatus WINGDIPAPI GdipDrawRectanglesI(GpGraphics *graphics, GpPen *pen,
1
0
0
0
Dmitry Timoshkov : gdiplus: Reimplement GdipDrawRectangle using GdipDrawPath.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: 1223569d644fdfb4e9b920ceeb18079dc6d819c8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1223569d644fdfb4e9b920cee…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:33 2013 +0800 gdiplus: Reimplement GdipDrawRectangle using GdipDrawPath. --- dlls/gdiplus/graphics.c | 34 +++++++++------------------------- 1 files changed, 9 insertions(+), 25 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 201ef7b..39c2b0f 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3398,9 +3398,8 @@ GpStatus WINGDIPAPI GdipDrawPieI(GpGraphics *graphics, GpPen *pen, INT x, GpStatus WINGDIPAPI GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height) { - INT save_state; - GpPointF ptf[4]; - POINT pti[4]; + GpStatus status; + GpPath *path; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height); @@ -3410,30 +3409,15 @@ GpStatus WINGDIPAPI GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x, if(graphics->busy) return ObjectBusy; - if (!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - - ptf[0].X = x; - ptf[0].Y = y; - ptf[1].X = x + width; - ptf[1].Y = y; - ptf[2].X = x + width; - ptf[2].Y = y + height; - ptf[3].X = x; - ptf[3].Y = y + height; - - save_state = prepare_dc(graphics, pen); - SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH)); - - transform_and_round_points(graphics, pti, ptf, 4); - Polygon(graphics->hdc, pti, 4); + status = GdipCreatePath(FillModeAlternate, &path); + if (status != Ok) return status; - restore_dc(graphics, save_state); + status = GdipAddPathRectangle(path, x, y, width, height); + if (status == Ok) + status = GdipDrawPath(graphics, pen, path); - return Ok; + GdipDeletePath(path); + return status; } GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
1
0
0
0
Dmitry Timoshkov : gdiplus: Reimplement GdipDrawPie using GdipDrawPath.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: 981223a7363738b2b90030e8e61d52aed186df85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=981223a7363738b2b90030e8e…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:28 2013 +0800 gdiplus: Reimplement GdipDrawPie using GdipDrawPath. --- dlls/gdiplus/graphics.c | 55 +++++++--------------------------------------- 1 files changed, 9 insertions(+), 46 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 7cf9e0e..201ef7b 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -51,18 +51,6 @@ static GpStatus draw_driver_string(GpGraphics *graphics, GDIPCONST UINT16 *text, GDIPCONST GpBrush *brush, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix); -/* Converts angle (in degrees) to x/y coordinates */ -static void deg2xy(REAL angle, REAL x_0, REAL y_0, REAL *x, REAL *y) -{ - REAL radAngle, hypotenuse; - - radAngle = deg2rad(angle); - hypotenuse = 50.0; /* arbitrary */ - - *x = x_0 + cos(radAngle) * hypotenuse; - *y = y_0 + sin(radAngle) * hypotenuse; -} - /* Converts from gdiplus path point type to gdi path point type. */ static BYTE convert_path_point_type(BYTE type) { @@ -1456,27 +1444,6 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush, } } -/* GdipDrawPie/GdipFillPie helper function */ -static void draw_pie(GpGraphics *graphics, REAL x, REAL y, REAL width, - REAL height, REAL startAngle, REAL sweepAngle) -{ - GpPointF ptf[4]; - POINT pti[4]; - - ptf[0].X = x; - ptf[0].Y = y; - ptf[1].X = x + width; - ptf[1].Y = y + height; - - deg2xy(startAngle+sweepAngle, x + width / 2.0, y + width / 2.0, &ptf[2].X, &ptf[2].Y); - deg2xy(startAngle, x + width / 2.0, y + width / 2.0, &ptf[3].X, &ptf[3].Y); - - transform_and_round_points(graphics, pti, ptf, 4); - - Pie(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y, pti[2].x, - pti[2].y, pti[3].x, pti[3].y); -} - /* Draws the linecap the specified color and size on the hdc. The linecap is in * direction of the line from x1, y1 to x2, y2 and is anchored on x2, y2. Probably * should not be called on an hdc that has a path you care about. */ @@ -3396,7 +3363,8 @@ GpStatus WINGDIPAPI GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path) GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { - INT save_state; + GpStatus status; + GpPath *path; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height, startAngle, sweepAngle); @@ -3407,20 +3375,15 @@ GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, if(graphics->busy) return ObjectBusy; - if (!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - - save_state = prepare_dc(graphics, pen); - SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH)); - - draw_pie(graphics, x, y, width, height, startAngle, sweepAngle); + status = GdipCreatePath(FillModeAlternate, &path); + if (status != Ok) return status; - restore_dc(graphics, save_state); + status = GdipAddPathPie(path, x, y, width, height, startAngle, sweepAngle); + if (status == Ok) + status = GdipDrawPath(graphics, pen, path); - return Ok; + GdipDeletePath(path); + return status; } GpStatus WINGDIPAPI GdipDrawPieI(GpGraphics *graphics, GpPen *pen, INT x,
1
0
0
0
Dmitry Timoshkov : gdiplus: Reimplement GdipDrawEllipse using GdipDrawPath.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: 6df50f1d164cce46b4d79fa78d54ffbe6bcaac2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6df50f1d164cce46b4d79fa78…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:23 2013 +0800 gdiplus: Reimplement GdipDrawEllipse using GdipDrawPath. --- dlls/gdiplus/graphics.c | 31 +++++++++---------------------- 1 files changed, 9 insertions(+), 22 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 997dd28..7cf9e0e 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2759,9 +2759,8 @@ GpStatus WINGDIPAPI GdipDrawCurve3I(GpGraphics *graphics, GpPen *pen, GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height) { - INT save_state; - GpPointF ptf[2]; - POINT pti[2]; + GpPath *path; + GpStatus status; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height); @@ -2771,27 +2770,15 @@ GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, if(graphics->busy) return ObjectBusy; - if (!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - - ptf[0].X = x; - ptf[0].Y = y; - ptf[1].X = x + width; - ptf[1].Y = y + height; - - save_state = prepare_dc(graphics, pen); - SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH)); - - transform_and_round_points(graphics, pti, ptf, 2); - - Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y); + status = GdipCreatePath(FillModeAlternate, &path); + if (status != Ok) return status; - restore_dc(graphics, save_state); + status = GdipAddPathEllipse(path, x, y, width, height); + if (status == Ok) + status = GdipDrawPath(graphics, pen, path); - return Ok; + GdipDeletePath(path); + return status; } GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x,
1
0
0
0
Dmitry Timoshkov : gdiplus: Forward GdipDrawBezier to GdipDrawBeziers.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: ad49f83c7dbcd60abd60c80409495e2ddb4cfde7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ad49f83c7dbcd60abd60c8040…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:18 2013 +0800 gdiplus: Forward GdipDrawBezier to GdipDrawBeziers. --- dlls/gdiplus/graphics.c | 77 +---------------------------------------------- 1 files changed, 1 insertions(+), 76 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 3253221..997dd28 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1756,66 +1756,6 @@ static void shorten_bezier_amt(GpPointF * pt, REAL amt, BOOL rev) } } -/* Draws bezier curves between given points, and if caps is true then draws an - * endcap at the end of the last line. */ -static GpStatus draw_polybezier(GpGraphics *graphics, GpPen *pen, - GDIPCONST GpPointF * pt, INT count, BOOL caps) -{ - POINT *pti; - GpPointF *ptcopy; - GpStatus status = GenericError; - - if(!count) - return Ok; - - pti = GdipAlloc(count * sizeof(POINT)); - ptcopy = GdipAlloc(count * sizeof(GpPointF)); - - if(!pti || !ptcopy){ - status = OutOfMemory; - goto end; - } - - memcpy(ptcopy, pt, count * sizeof(GpPointF)); - - if(caps){ - if(pen->endcap == LineCapArrowAnchor) - shorten_bezier_amt(&ptcopy[count-4], pen->width, FALSE); - else if((pen->endcap == LineCapCustom) && pen->customend) - shorten_bezier_amt(&ptcopy[count-4], pen->width * pen->customend->inset, - FALSE); - - if(pen->startcap == LineCapArrowAnchor) - shorten_bezier_amt(ptcopy, pen->width, TRUE); - else if((pen->startcap == LineCapCustom) && pen->customstart) - shorten_bezier_amt(ptcopy, pen->width * pen->customstart->inset, TRUE); - - /* the direction of the line cap is parallel to the direction at the - * end of the bezier (which, if it has been shortened, is not the same - * as the direction from pt[count-2] to pt[count-1]) */ - draw_cap(graphics, get_gdi_brush_color(pen->brush), pen->endcap, pen->width, pen->customend, - pt[count - 1].X - (ptcopy[count - 1].X - ptcopy[count - 2].X), - pt[count - 1].Y - (ptcopy[count - 1].Y - ptcopy[count - 2].Y), - pt[count - 1].X, pt[count - 1].Y); - - draw_cap(graphics, get_gdi_brush_color(pen->brush), pen->startcap, pen->width, pen->customstart, - pt[0].X - (ptcopy[0].X - ptcopy[1].X), - pt[0].Y - (ptcopy[0].Y - ptcopy[1].Y), pt[0].X, pt[0].Y); - } - - transform_and_round_points(graphics, pti, ptcopy, count); - - PolyBezier(graphics->hdc, pti, count); - - status = Ok; - -end: - GdipFree(pti); - GdipFree(ptcopy); - - return status; -} - /* Draws a combination of bezier curves and lines between points. */ static GpStatus draw_poly(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF * pt, GDIPCONST BYTE * types, INT count, BOOL caps) @@ -2538,9 +2478,7 @@ GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics *graphics, GpPen *pen, INT x, GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4) { - INT save_state; GpPointF pt[4]; - GpStatus retval; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x1, y1, x2, y2, x3, y3, x4, y4); @@ -2551,12 +2489,6 @@ GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics *graphics, GpPen *pen, REAL x1, if(graphics->busy) return ObjectBusy; - if (!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - pt[0].X = x1; pt[0].Y = y1; pt[1].X = x2; @@ -2565,14 +2497,7 @@ GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics *graphics, GpPen *pen, REAL x1, pt[2].Y = y3; pt[3].X = x4; pt[3].Y = y4; - - save_state = prepare_dc(graphics, pen); - - retval = draw_polybezier(graphics, pen, pt, 4, TRUE); - - restore_dc(graphics, save_state); - - return retval; + return GdipDrawBeziers(graphics, pen, pt, 4); } GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1,
1
0
0
0
Dmitry Timoshkov : gdiplus: Reimplement GdipDrawBeziers using GdipDrawPath.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: ae8826c43ef782b34cabc8ac38080f21387b4d9b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ae8826c43ef782b34cabc8ac3…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:12 2013 +0800 gdiplus: Reimplement GdipDrawBeziers using GdipDrawPath. --- dlls/gdiplus/graphics.c | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index b408db4..3253221 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2587,8 +2587,8 @@ GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1, GpStatus WINGDIPAPI GdipDrawBeziers(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count) { - INT i; - GpStatus ret; + GpStatus status; + GpPath *path; TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count); @@ -2598,17 +2598,15 @@ GpStatus WINGDIPAPI GdipDrawBeziers(GpGraphics *graphics, GpPen *pen, if(graphics->busy) return ObjectBusy; - for(i = 0; i < floor(count / 4); i++){ - ret = GdipDrawBezier(graphics, pen, - points[4*i].X, points[4*i].Y, - points[4*i + 1].X, points[4*i + 1].Y, - points[4*i + 2].X, points[4*i + 2].Y, - points[4*i + 3].X, points[4*i + 3].Y); - if(ret != Ok) - return ret; - } + status = GdipCreatePath(FillModeAlternate, &path); + if (status != Ok) return status; - return Ok; + status = GdipAddPathBeziers(path, points, count); + if (status == Ok) + status = GdipDrawPath(graphics, pen, path); + + GdipDeletePath(path); + return status; } GpStatus WINGDIPAPI GdipDrawBeziersI(GpGraphics *graphics, GpPen *pen,
1
0
0
0
Dmitry Timoshkov : gdiplus: Reimplement GdipDrawArc using GdipDrawPath.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: 89f380f69b36680cba2bc16ea03ee60231a73230 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=89f380f69b36680cba2bc16ea…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:08 2013 +0800 gdiplus: Reimplement GdipDrawArc using GdipDrawPath. --- dlls/gdiplus/graphics.c | 25 +++++++++---------------- 1 files changed, 9 insertions(+), 16 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 738a54c..b408db4 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2503,9 +2503,8 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics) GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { - INT save_state, num_pts; - GpPointF points[MAX_ARC_PTS]; - GpStatus retval; + GpStatus status; + GpPath *path; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height, startAngle, sweepAngle); @@ -2516,21 +2515,15 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x, if(graphics->busy) return ObjectBusy; - if (!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - - num_pts = arc2polybezier(points, x, y, width, height, startAngle, sweepAngle); - - save_state = prepare_dc(graphics, pen); - - retval = draw_polybezier(graphics, pen, points, num_pts, TRUE); + status = GdipCreatePath(FillModeAlternate, &path); + if (status != Ok) return status; - restore_dc(graphics, save_state); + status = GdipAddPathArc(path, x, y, width, height, startAngle, sweepAngle); + if (status == Ok) + status = GdipDrawPath(graphics, pen, path); - return retval; + GdipDeletePath(path); + return status; } GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics *graphics, GpPen *pen, INT x,
1
0
0
0
Dmitry Timoshkov : gdiplus: Reimplement GdipDrawLines using GdipDrawPath.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: 2fd1bf60aef8ab14ab128963eb5c009cac9f58e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2fd1bf60aef8ab14ab128963e…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:45:02 2013 +0800 gdiplus: Reimplement GdipDrawLines using GdipDrawPath. --- dlls/gdiplus/graphics.c | 79 +++++----------------------------------------- 1 files changed, 9 insertions(+), 70 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 7f221bb..738a54c 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1713,63 +1713,6 @@ static void shorten_line_amt(REAL x1, REAL y1, REAL *x2, REAL *y2, REAL amt) shorten_line_percent(x1, y1, x2, y2, percent); } -/* Draws lines between the given points, and if caps is true then draws an endcap - * at the end of the last line. */ -static GpStatus draw_polyline(GpGraphics *graphics, GpPen *pen, - GDIPCONST GpPointF * pt, INT count, BOOL caps) -{ - POINT *pti = NULL; - GpPointF *ptcopy = NULL; - GpStatus status = GenericError; - - if(!count) - return Ok; - - pti = GdipAlloc(count * sizeof(POINT)); - ptcopy = GdipAlloc(count * sizeof(GpPointF)); - - if(!pti || !ptcopy){ - status = OutOfMemory; - goto end; - } - - memcpy(ptcopy, pt, count * sizeof(GpPointF)); - - if(caps){ - if(pen->endcap == LineCapArrowAnchor) - shorten_line_amt(ptcopy[count-2].X, ptcopy[count-2].Y, - &ptcopy[count-1].X, &ptcopy[count-1].Y, pen->width); - else if((pen->endcap == LineCapCustom) && pen->customend) - shorten_line_amt(ptcopy[count-2].X, ptcopy[count-2].Y, - &ptcopy[count-1].X, &ptcopy[count-1].Y, - pen->customend->inset * pen->width); - - if(pen->startcap == LineCapArrowAnchor) - shorten_line_amt(ptcopy[1].X, ptcopy[1].Y, - &ptcopy[0].X, &ptcopy[0].Y, pen->width); - else if((pen->startcap == LineCapCustom) && pen->customstart) - shorten_line_amt(ptcopy[1].X, ptcopy[1].Y, - &ptcopy[0].X, &ptcopy[0].Y, - pen->customstart->inset * pen->width); - - draw_cap(graphics, get_gdi_brush_color(pen->brush), pen->endcap, pen->width, pen->customend, - pt[count - 2].X, pt[count - 2].Y, pt[count - 1].X, pt[count - 1].Y); - draw_cap(graphics, get_gdi_brush_color(pen->brush), pen->startcap, pen->width, pen->customstart, - pt[1].X, pt[1].Y, pt[0].X, pt[0].Y); - } - - transform_and_round_points(graphics, pti, ptcopy, count); - - if(Polyline(graphics->hdc, pti, count)) - status = Ok; - -end: - GdipFree(pti); - GdipFree(ptcopy); - - return status; -} - /* Conducts a linear search to find the bezier points that will back off * the endpoint of the curve by a distance of amt. Linear search works * better than binary in this case because there are multiple solutions, @@ -3473,8 +3416,8 @@ GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1, GpStatus WINGDIPAPI GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count) { - INT save_state; - GpStatus retval; + GpStatus status; + GpPath *path; TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count); @@ -3484,19 +3427,15 @@ GpStatus WINGDIPAPI GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST if(graphics->busy) return ObjectBusy; - if (!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - - save_state = prepare_dc(graphics, pen); - - retval = draw_polyline(graphics, pen, points, count, TRUE); + status = GdipCreatePath(FillModeAlternate, &path); + if (status != Ok) return status; - restore_dc(graphics, save_state); + status = GdipAddPathLine2(path, points, count); + if (status == Ok) + status = GdipDrawPath(graphics, pen, path); - return retval; + GdipDeletePath(path); + return status; } GpStatus WINGDIPAPI GdipDrawLinesI(GpGraphics *graphics, GpPen *pen, GDIPCONST
1
0
0
0
Dmitry Timoshkov : gdiplus: Reimplement GdipDrawCurve2 using GdipDrawPath.
by Alexandre Julliard
19 Feb '13
19 Feb '13
Module: wine Branch: master Commit: 03228b1784c6d7b66aed6d106fdb5bae120cdb66 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=03228b1784c6d7b66aed6d106…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 19 11:44:57 2013 +0800 gdiplus: Reimplement GdipDrawCurve2 using GdipDrawPath. --- dlls/gdiplus/graphics.c | 59 +++++++--------------------------------------- 1 files changed, 9 insertions(+), 50 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index c48ed2d..7f221bb 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2815,11 +2815,8 @@ GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics *graphics, GpPen *pen, GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension) { - /* PolyBezier expects count*3-2 points. */ - INT i, len_pt = count*3-2, save_state; - GpPointF *pt; - REAL x1, x2, y1, y2; - GpStatus retval; + GpPath *path; + GpStatus status; TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension); @@ -2832,53 +2829,15 @@ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, if(count < 2) return InvalidParameter; - if (!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - - pt = GdipAlloc(len_pt * sizeof(GpPointF)); - if(!pt) - return OutOfMemory; - - tension = tension * TENSION_CONST; - - calc_curve_bezier_endp(points[0].X, points[0].Y, points[1].X, points[1].Y, - tension, &x1, &y1); - - pt[0].X = points[0].X; - pt[0].Y = points[0].Y; - pt[1].X = x1; - pt[1].Y = y1; - - for(i = 0; i < count-2; i++){ - calc_curve_bezier(&(points[i]), tension, &x1, &y1, &x2, &y2); - - pt[3*i+2].X = x1; - pt[3*i+2].Y = y1; - pt[3*i+3].X = points[i+1].X; - pt[3*i+3].Y = points[i+1].Y; - pt[3*i+4].X = x2; - pt[3*i+4].Y = y2; - } - - calc_curve_bezier_endp(points[count-1].X, points[count-1].Y, - points[count-2].X, points[count-2].Y, tension, &x1, &y1); - - pt[len_pt-2].X = x1; - pt[len_pt-2].Y = y1; - pt[len_pt-1].X = points[count-1].X; - pt[len_pt-1].Y = points[count-1].Y; - - save_state = prepare_dc(graphics, pen); - - retval = draw_polybezier(graphics, pen, pt, len_pt, TRUE); + status = GdipCreatePath(FillModeAlternate, &path); + if (status != Ok) return status; - GdipFree(pt); - restore_dc(graphics, save_state); + status = GdipAddPathCurve2(path, points, count, tension); + if (status == Ok) + status = GdipDrawPath(graphics, pen, path); - return retval; + GdipDeletePath(path); + return status; } GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen,
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
46
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
Results per page:
10
25
50
100
200