From: David Kahurani k.kahurani@gmail.com
trace_path calls poly_draw which will in turn call SOFTWARE_GdipFillPath which will again call trace_path leading to a circular dependency
Signed-off-by: David Kahurani k.kahurani@gmail.com --- dlls/gdiplus/graphics.c | 47 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 54c07a4db8c..3845ce376ca 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2050,13 +2050,52 @@ end:
GpStatus trace_path(GpGraphics *graphics, GpPath *path) { - GpStatus result; + POINT *pti = heap_alloc_zero(path->pathdata.Count * sizeof(POINT)); + BYTE *tp = heap_alloc_zero(path->pathdata.Count); + GpPointF *ptcopy = heap_alloc_zero(path->pathdata.Count * sizeof(GpPointF)); + INT i; + GpStatus status = GenericError; + + if(!path->pathdata.Count){ + status = Ok; + goto end; + } + if(!pti || !tp || !ptcopy){ + status = OutOfMemory; + goto end; + } + + for(i = 1; i < path->pathdata.Count; i++){ + if((path->pathdata.Types[i] & PathPointTypePathTypeMask) == PathPointTypeBezier){ + if((i + 2 >= path->pathdata.Count) || !(path->pathdata.Types[i + 1] & PathPointTypeBezier) + || !(path->pathdata.Types[i + 2] & PathPointTypeBezier)){ + ERR("Bad bezier points\n"); + goto end; + } + i += 2; + } + } + + memcpy(ptcopy, path->pathdata.Points, path->pathdata.Count * sizeof(GpPointF)); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptcopy, path->pathdata.Count); + round_points(pti, ptcopy, path->pathdata.Count); + + for(i = 0; i < path->pathdata.Count; i++){ + tp[i] = convert_path_point_type(path->pathdata.Types[i]); + }
BeginPath(graphics->hdc); - result = draw_poly(graphics, NULL, path->pathdata.Points, - path->pathdata.Types, path->pathdata.Count, FALSE); + PolyDraw(graphics->hdc, pti, tp, path->pathdata.Count); EndPath(graphics->hdc); - return result; + + status = Ok; + +end: + heap_free(pti); + heap_free(ptcopy); + heap_free(tp); + + return status; }
typedef enum GraphicsContainerType {