Found by Mono's System.Drawing tests.
From: Esme Povirk esme@codeweavers.com
--- dlls/gdiplus/graphicspath.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 53e0d1d6a35..7b45e08e971 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -324,6 +324,28 @@ static GpStatus extend_current_figure(GpPath *path, GDIPCONST PointF *points, IN return Ok; }
+static GpStatus add_closed_figure(GpPath *path, GDIPCONST PointF *points, INT count, BYTE type) +{ + INT insert_index = path->pathdata.Count; + + if(!count) + return Ok; + + if(!lengthen_path(path, count)) + return OutOfMemory; + + memcpy(path->pathdata.Points + insert_index, points, sizeof(GpPointF)*count); + path->pathdata.Types[insert_index] = PathPointTypeStart; + memset(path->pathdata.Types + insert_index + 1, type, count - 1); + + path->newfigure = TRUE; + path->pathdata.Count += count; + path->pathdata.Types[path->pathdata.Count - 1] |= PathPointTypeCloseSubpath; + + return Ok; +} + + /******************************************************************************* * GdipAddPathArc [GDIPLUS.1] * @@ -536,13 +558,7 @@ GpStatus WINGDIPAPI GdipAddPathClosedCurve2(GpPath *path, GDIPCONST GpPointF *po pt[len_pt-1].X = pt[0].X; pt[len_pt-1].Y = pt[0].Y;
- stat = extend_current_figure(path, pt, len_pt, PathPointTypeBezier); - - /* close figure */ - if(stat == Ok){ - path->pathdata.Types[path->pathdata.Count - 1] |= PathPointTypeCloseSubpath; - path->newfigure = TRUE; - } + stat = add_closed_figure(path, pt, len_pt, PathPointTypeBezier);
free(pts); free(pt);
From: Esme Povirk esme@codeweavers.com
--- dlls/gdiplus/graphicspath.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 7b45e08e971..b1e417842f8 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -881,7 +881,6 @@ GpStatus WINGDIPAPI GdipAddPathPie(GpPath *path, REAL x, REAL y, REAL width, REA REAL startAngle, REAL sweepAngle) { GpPointF *ptf; - GpStatus status; INT i, count;
TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", @@ -912,28 +911,29 @@ GpStatus WINGDIPAPI GdipAddPathPie(GpPath *path, REAL x, REAL y, REAL width, REA
arc2polybezier(ptf, x, y, width, height, startAngle, sweepAngle);
- status = GdipAddPathLine(path, x + width/2, y + height/2, ptf[0].X, ptf[0].Y); - if(status != Ok){ - free(ptf); - return status; - } - /* one spline is already added as a line endpoint */ - if(!lengthen_path(path, count - 1)){ + if (!lengthen_path(path, count + 1)) + { free(ptf); return OutOfMemory; }
- memcpy(&(path->pathdata.Points[path->pathdata.Count]), &(ptf[1]),sizeof(GpPointF)*(count-1)); + path->pathdata.Points[path->pathdata.Count].X = x + width/2; + path->pathdata.Points[path->pathdata.Count].Y = y + height/2; + path->pathdata.Types[path->pathdata.Count] = PathPointTypeStart; + + memcpy(&(path->pathdata.Points[path->pathdata.Count + 1]), ptf, sizeof(GpPointF)*(count)); + + path->pathdata.Types[path->pathdata.Count + 1] = PathPointTypeLine; for(i = 0; i < count-1; i++) - path->pathdata.Types[path->pathdata.Count+i] = PathPointTypeBezier; + path->pathdata.Types[path->pathdata.Count + 2 + i] = PathPointTypeBezier;
- path->pathdata.Count += count-1; + path->pathdata.Count += count + 1;
GdipClosePathFigure(path);
free(ptf);
- return status; + return Ok; }
GpStatus WINGDIPAPI GdipAddPathPieI(GpPath *path, INT x, INT y, INT width, INT height,
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150861
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 0000000000A900F8, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032