[PATCH 0/1] MR10554: gdiplus: Initial implementation of GdipWarpPath
From: Bartosz Kosiorek <gang65@poczta.onet.pl> --- dlls/gdiplus/graphicspath.c | 18 ++++++++++++++++++ dlls/gdiplus/tests/graphicspath.c | 18 +++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index a18f37395d2..3df7f0382a6 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1929,6 +1929,24 @@ GpStatus WINGDIPAPI GdipWarpPath(GpPath *path, GpMatrix* matrix, FIXME("(%p,%s,%p,%i,%0.2f,%0.2f,%0.2f,%0.2f,%i,%0.2f)\n", path, debugstr_matrix(matrix), points, count, x, y, width, height, warpmode, flatness); + if (!path || !points || count <= 0) + return InvalidParameter; + + if (count < 3) + count = 3; + + if (count != 3 && count != 4) + return InvalidParameter; + + if (warpmode != WarpModePerspective && warpmode != WarpModeBilinear) + return InvalidParameter; + + if (warpmode == WarpModeBilinear && count != 4) + return InvalidParameter; + + if (width == 0.0f || height == 0.0f) + return InvalidParameter; + return NotImplemented; } diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 2a92f842101..799af2e11b5 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1503,15 +1503,27 @@ static void test_warp_path(void) /* NULL path */ status = GdipWarpPath(NULL, NULL, dest_points, count, 0.0, 0.0, 128.0, 128.0, WarpModePerspective, FlatnessDefault); - todo_wine expect(InvalidParameter, status); + expect(InvalidParameter, status); /* NULL destination points */ status = GdipWarpPath(path, NULL, NULL, count, 0.0, 0.0, 128.0, 128.0, WarpModePerspective, FlatnessDefault); - todo_wine expect(InvalidParameter, status); + expect(InvalidParameter, status); /* Zero number of point in destination points */ status = GdipWarpPath(path, NULL, dest_points, 0, 0.0, 0.0, 128.0, 128.0, WarpModePerspective, FlatnessDefault); - todo_wine expect(InvalidParameter, status); + expect(InvalidParameter, status); + + /* Valid bilinear warp with not enough points */ + status = GdipWarpPath(path, NULL, dest_points, 1, 0.0, 0.0, 128.0, 128.0, WarpModeBilinear, FlatnessDefault); + expect(InvalidParameter, status); + + /* Valid warp with zero width */ + status = GdipWarpPath(path, NULL, dest_points, 1, 0.0, 0.0, 0.0, 128.0, WarpModePerspective, FlatnessDefault); + expect(InvalidParameter, status); + + /* Valid warp with zero height */ + status = GdipWarpPath(path, NULL, dest_points, 1, 0.0, 0.0, 128.0, 0.0, WarpModePerspective, FlatnessDefault); + expect(InvalidParameter, status); /* Valid warp with one destination point */ status = GdipWarpPath(path, NULL, dest_points, 1, 0.0, 0.0, 128.0, 128.0, WarpModePerspective, FlatnessDefault); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10554
This merge request was closed by Bartosz Kosiorek. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10554
participants (2)
-
Bartosz Kosiorek -
Bartosz Kosiorek (@gang65)