From: Bartosz Kosiorek gang65@poczta.onet.pl
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55717 --- dlls/gdiplus/graphicspath.c | 7 +- dlls/gdiplus/tests/graphicspath.c | 122 +++++++++++++++++++++++++++++- 2 files changed, 127 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 8e436f96f4e..d6af4918d60 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1793,7 +1793,12 @@ GpStatus WINGDIPAPI GdipIsVisiblePathPoint(GpPath* path, REAL x, REAL y, GpGraph if(status != Ok) return status;
- status = GdipGetRegionHRgn(region, NULL, &hrgn); + if (graphics && graphics->image) + status = GdipGetRegionHRgn(region, NULL, &hrgn); + // status = GdipGetRegionHRgn(region, graphics, &hrgn); + else + status = GdipGetRegionHRgn(region, NULL, &hrgn); + if(status != Ok){ GdipDeleteRegion(region); return status; diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 908ca8bcaf0..3e43ccae97b 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1847,6 +1847,7 @@ static void test_isvisible(void) status = GdipIsVisiblePathPoint(path, 0.0, 0.0, NULL, &result); expect(Ok, status); expect(FALSE, result); + /* rect */ status = GdipAddPathRectangle(path, 0.0, 0.0, 10.0, 10.0); expect(Ok, status); @@ -1877,10 +1878,128 @@ static void test_isvisible(void) expect(Ok, status); expect(FALSE, result); GdipResetWorldTransform(graphics); + GdipDeletePath(path); + GdipDeleteGraphics(graphics); +} + +static void test_is_outline_visible_path_point(void) +{ + GpPath *path; + GpGraphics *graphics = NULL; + BOOL result; + GpStatus status; + static const int width = 20, height = 20; + GpBitmap *bitmap; + + GpPen *pen = NULL; + + /* Graphics associated with an Image object.*/ + status = GdipCreateBitmapFromScan0(width, height, 0, PixelFormat32bppRGB, NULL, &bitmap); + expect(Ok, status); + status = GdipGetImageGraphicsContext((GpImage *)bitmap, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected the graphics context to be initialized.\n"); + + status = GdipCreatePath(FillModeAlternate, &path); + expect(Ok, status); + + status = GdipAddPathRectangle(path, 0.0, 0.0, 15.0, 15.0); + expect(Ok, status); + + status = GdipCreatePen1((ARGB)0xffff00ff, 3.0f, UnitPixel, &pen); + expect(Ok, status); + ok(pen != NULL, "Expected pen to be initialized\n");
+ /* Without transformation */ + result = FALSE; + status = GdipIsOutlineVisiblePathPoint(path, 10.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(TRUE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 17.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + + // If translating then there is no scaling but it prints out the path without pen weight (0,0 annd 15, 0) + status = GdipTranslateWorldTransform(graphics, 50.0, 50.0, MatrixOrderPrepend); + expect(Ok, status); + status = GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend); + expect(Ok, status); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 10.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = FALSE; + status = GdipIsOutlineVisiblePathPoint(path, 15.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(TRUE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 17.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + + // If scaling then there is no scaling but it prints out the path without pen weight (0,0 annd 15, 0) + status = GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend); + expect(Ok, status); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 10.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 17.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + + // for (INT i = -30; i<120; i++) { + // status = GdipIsOutlineVisiblePathPoint(path, i, 1.0, pen, graphics, &result); + // expect(Ok, status); + // expect(FALSE, result); + + // ok(FALSE, "r %d, %d \n", i, result); + // } + + /* affected by page unit but it prints out the path without pen weight (0,0 and 15, 0)*/ + GdipResetWorldTransform(graphics); + status = GdipSetPageUnit(graphics, UnitMillimeter); + expect(Ok, status); + result = FALSE; + status = GdipIsOutlineVisiblePathPoint(path, 0.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(TRUE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 1.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 10.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = FALSE; + status = GdipIsOutlineVisiblePathPoint(path, 15.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(TRUE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 16.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 17.0, 1.0, pen, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + + + // for (INT i = -3; i<20; i++) { + // status = GdipIsOutlineVisiblePathPoint(path, i, 1.0, pen, graphics, &result); + // expect(Ok, status); + // expect(FALSE, result); + + // ok(FALSE, "r %d, %d \n", i, result); + // } + + + GdipResetWorldTransform(graphics); GdipDeletePath(path); GdipDeleteGraphics(graphics); - ReleaseDC(0, hdc); }
static void test_empty_rect(void) @@ -1976,6 +2095,7 @@ START_TEST(graphicspath) test_widen(); test_widen_cap(); test_isvisible(); + test_is_outline_visible_path_point(); test_empty_rect();
GdiplusShutdown(gdiplusToken);
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=138999
Your paranoid android.
=== debian11 (32 bit report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11 (32 bit ar:MA report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11 (32 bit de report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11 (32 bit fr report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11 (32 bit he:IL report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11 (32 bit hi:IN report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11 (32 bit ja:JP report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11 (32 bit zh:CN report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11b (32 bit WoW report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000
=== debian11b (64 bit WoW report) ===
gdiplus: graphicspath.c:1968: Test failed: Expected 00000001, got 00000000 graphicspath.c:1980: Test failed: Expected 00000001, got 00000000