This is a half-witted attempt at avoiding GdipGetRegionHrgn. in GdipFillPath. The use of GdipGetRegionHrgn happens as consequence of the use of regions in internal code. From the look of it, as per the development plans, it should be possible to remove it by avoiding internal use of regions.
This could be done, for instance, by reducing a region to a path before computing on it or rendering it. However, this is going to be fairly if not very complicated and, just like with the other MR, will not guarantee optimization.
This patch, for instance, might not have observable optimization impact. This is because 'trace_path' and 'PathToRegion' are still being used and are probably the most computation heavy sections of GdipGetRegionHrgn. Still, it should be possible to compute the exactly what data to render without these two methods. This could however get a bit complicated.
Signed-off-by: David Kahurani k.kahurani@gmail.com
From: David Kahurani k.kahurani@gmail.com
This is a half-witted attempt at avoiding GdipGetRegionHrgn. in GdipFillPath. The use of GdipGetRegionHrgn happens as consequence of the use of regions in internal code. From the look of it, as per the development plans, it should be possible to remove it by avoiding internal use of regions.
This could be done, for instance, by reducing a region to a path before computing on it or rendering it. However, this is going to be fairly if not very complicated and, just like with the other MR, will not guarantee optimization.
This patch, for instance, might not have observable optimization impact. This is because 'trace_path' and 'PathToRegion' are still being used and are probably the most computation heavy sections of GdipGetRegionHrgn. Still, it should be possible to compute the exactly what data to render without these two methods. This could however get a bit complicated.
Signed-off-by: David Kahurani k.kahurani@gmail.com --- dlls/gdiplus/graphics.c | 60 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 70b88830ca2..51ebcd7959f 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4351,19 +4351,71 @@ static GpStatus SOFTWARE_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPa { GpStatus stat; GpRegion *rgn; + GpRectF bounds; + RECT bound_rect; + DWORD *pixel_data; + HRGN display, src, dst; + GpMatrix device_to_world;
if (!brush_can_fill_pixels(brush)) return NotImplemented;
- /* FIXME: This could probably be done more efficiently without regions. */ + stat = get_graphics_device_bounds(graphics, &bounds); + display = CreateRectRgn(bounds.X, bounds.Y, bounds.X + bounds.Width, bounds.Y + bounds.Height); + + if (stat == Ok) + stat = get_graphics_transform(graphics, WineCoordinateSpaceGdiDevice, + CoordinateSpaceWorld, &device_to_world); + + stat = GdipTransformPath(path, &device_to_world);
- stat = GdipCreateRegionPath(path, &rgn); + gdi_transform_acquire(graphics); + stat = trace_path(graphics, path);
if (stat == Ok) { - stat = GdipFillRegion(graphics, brush, rgn); + src = PathToRegion(graphics->hdc); + stat = src ? Ok : OutOfMemory; + }
- GdipDeleteRegion(rgn); + CombineRgn(dst, src, display, RGN_AND); + + if (stat == Ok && GetRgnBox(dst, &bound_rect) == NULLREGION) + { + DeleteObject(dst); + gdi_transform_release(graphics); + return Ok; + } + + if (stat == Ok) + { + GpRect gp_bound_rect; + + gp_bound_rect.X = bound_rect.left; + gp_bound_rect.Y = bound_rect.top; + gp_bound_rect.Width = bound_rect.right - bound_rect.left; + gp_bound_rect.Height = bound_rect.bottom - bound_rect.top; + + pixel_data = calloc(gp_bound_rect.Width * gp_bound_rect.Height, sizeof(*pixel_data)); + + if (!pixel_data) + stat = OutOfMemory; + + if (!pixel_data) + stat = OutOfMemory; + + if (stat == Ok) + { + stat = brush_fill_pixels(graphics, brush, pixel_data, &gp_bound_rect, gp_bound_rect.Width); + if (stat == Ok) + stat = alpha_blend_pixels_hrgn(graphics, gp_bound_rect.X, gp_bound_rect.Y, (BYTE*)pixel_data, gp_bound_rect.Width, gp_bound_rect.Height, gp_bound_rect.Width * 4, dst, PixelFormat32bppARGB); + free(pixel_data); + } + + DeleteObject(dst); + DeleteObject(src); + DeleteObject(display); + gdi_transform_release(graphics); }
return stat;
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=143391
Your paranoid android.
=== debian11 (32 bit report) ===
gdiplus: brush.c:424: Test failed: Expected 00000000, got 00000003 brush.c:452: Test failed: Expected 00000000, got 00000003 brush.c:478: Test failed: Expected 00000000, got 00000003 brush.c:504: Test failed: Expected 00000000, got 00000003 brush.c:538: Test failed: Expected 00000000, got 00000003 brush.c:564: Test failed: Expected 00000000, got 00000003 brush.c:592: Test failed: Expected 00000000, got 00000003 brush.c:615: Test failed: Expected 00000000, got 00000003 brush.c:626: Test failed: Failed to rotate image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x3 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x4 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x5 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x6 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x7 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x8 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x9 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0xa with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0xb with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0xc with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0xd with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0xe with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0xf with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x10 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x11 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x12 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x13 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x14 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x15 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x16 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x17 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x18 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x19 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1a with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1b with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1c with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1d with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1e with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1f with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x20 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x21 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x22 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x23 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x24 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x25 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x26 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x27 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x28 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x29 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2a with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2b with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2c with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2d with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2e with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2f with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x30 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x31 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x32 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x33 with image. brush.c:1812: Test failed: Expected 00000000, got 00000003 brush.c:1836: Test failed: Unexpected pattern for hatch style 0x34 with image. brush.c:1925: Test failed: Hatch brush rendered incorrectly on image with rendering origin (3, 6). brush.c:1925: Test failed: Hatch brush rendered incorrectly on image with rendering origin (-7, -4). graphics.c:2690: Test failed: Expected 104, got 0 graphics.c:5206: Test failed: Expected -5592406, got -559038737 graphics.c:6742: Test failed: Expected GdipFillRectangleI take effect! graphics.c:6811: Test failed: Expected 0, got 3 graphics.c:6829: Test failed: Expected GdipFillRectangleI take effect! graphics.c:7001: Test failed: Expected 0, got 3 graphics.c:7004: Test failed: Expected -5592406, got 0 graphics.c:7005: Test failed: Expected -5592406, got 0 graphics.c:7014: Test failed: Expected 0, got 3 graphics.c:7017: Test failed: Expected -5592406, got 0 graphics.c:7018: Test failed: Expected -5592406, got 0 graphics.c:7079: Test failed: Expected 0, got 3 graphics.c:7112: Test failed: Expected -16776961, got 0 graphics.c:7214: Test failed: Expected 0, got 3 graphics.c:7250: Test failed: Expected -5635841, got 0 image.c:6296: Test failed: bits don't match metafile.c:292: Test failed: fillrect playback.2: GdipPlayMetafileRecord failed with stat 3 metafile.c:1138: Test failed: Expected -16776961, got 00000000 metafile.c:292: Test failed: fillrect playback.2: GdipPlayMetafileRecord failed with stat 3 metafile.c:1147: Test failed: Expected -16776961, got 00000000 metafile.c:1166: Test failed: Expected -16776961, got 00000000 metafile.c:1243: Test failed: Expected -00000256, got -16777216 metafile.c:292: Test failed: pagetransform playback.2: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: pagetransform playback.4: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: pagetransform playback.6: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: pagetransform playback.8: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: pagetransform playback.10: GdipPlayMetafileRecord failed with stat 3 metafile.c:1610: Test failed: Expected -16776961, got 00000000 metafile.c:1614: Test failed: Expected -16711936, got 00000000 metafile.c:1618: Test failed: Expected -16711681, got 00000000 metafile.c:1622: Test failed: Expected -00065536, got 00000000 metafile.c:1626: Test failed: Expected -00065281, got 00000000 metafile.c:292: Test failed: worldtransform playback.2: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.4: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.6: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.8: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.10: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.12: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.14: GdipPlayMetafileRecord failed with stat 3 metafile.c:1882: Test failed: Expected -16776961, got 00000000 metafile.c:1886: Test failed: Expected -16711936, got 00000000 metafile.c:1890: Test failed: Expected -16711681, got 00000000 metafile.c:1894: Test failed: Expected -00065536, got 00000000 metafile.c:1898: Test failed: Expected -00065281, got 00000000 metafile.c:1902: Test failed: Expected -00000256, got 00000000 metafile.c:1906: Test failed: Expected -00000001, got 00000000 metafile.c:292: Test failed: container playback.4: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: container playback.7: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: container playback.15: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: container playback.17: GdipPlayMetafileRecord failed with stat 3 metafile.c:2239: Test failed: Expected -16777216, got 00000000 metafile.c:2243: Test failed: Expected -16776961, got 00000000 metafile.c:2247: Test failed: Expected -16711936, got 00000000 metafile.c:2251: Test failed: Expected -16711681, got 00000000 metafile.c:292: Test failed: clipping playback.4: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: clipping playback.7: GdipPlayMetafileRecord failed with stat 3 metafile.c:2381: Test failed: Expected -16777216, got 00000000 metafile.c:2385: Test failed: Expected -16776961, got 00000000 metafile.c:292: Test failed: lineargradient playback.3: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: lineargradient playback.5: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: lineargradient playback.7: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: lineargradient playback.9: GdipPlayMetafileRecord failed with stat 3 metafile.c:3434: Test failed: Expected -00065536, got 00000000 metafile.c:3438: Test failed: Expected -06750106, got 00000000 metafile.c:3443: Test failed: Expected -00065536, got 00000000 metafile.c:3447: Test failed: Expected -06750106, got 00000000 metafile.c:3452: Test failed: Expected -00065536, got 00000000 metafile.c:3456: Test failed: Expected -12123976, got 00000000 metafile.c:3461: Test failed: Expected -00065536, got 00000000 metafile.c:3465: Test failed: Expected -16711936, got 00000000
=== debian11b (64 bit WoW report) ===
gdiplus: brush.c:626: Test failed: Failed to rotate image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x3 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x4 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x5 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x6 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x7 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x8 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x9 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0xa with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0xb with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0xc with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0xd with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0xe with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0xf with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x10 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x11 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x12 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x13 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x14 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x15 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x16 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x17 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x18 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x19 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1a with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1b with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1c with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1d with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1e with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x1f with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x20 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x21 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x22 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x23 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x24 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x25 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x26 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x27 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x28 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x29 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2a with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2b with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2c with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2d with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2e with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x2f with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x30 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x31 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x32 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x33 with image. brush.c:1836: Test failed: Unexpected pattern for hatch style 0x34 with image. brush.c:1925: Test failed: Hatch brush rendered incorrectly on image with rendering origin (3, 6). brush.c:1925: Test failed: Hatch brush rendered incorrectly on image with rendering origin (-7, -4). graphics.c:2690: Test failed: Expected 104, got 0 graphics.c:5206: Test failed: Expected -5592406, got -559038737 graphics.c:6742: Test failed: Expected GdipFillRectangleI take effect! graphics.c:6811: Test failed: Expected 0, got 3 graphics.c:6829: Test failed: Expected GdipFillRectangleI take effect! graphics.c:7004: Test failed: Expected -5592406, got 0 graphics.c:7005: Test failed: Expected -5592406, got 0 graphics.c:7017: Test failed: Expected -5592406, got 0 graphics.c:7018: Test failed: Expected -5592406, got 0 graphics.c:7079: Test failed: Expected 0, got 3 graphics.c:7112: Test failed: Expected -16776961, got 0 graphics.c:7250: Test failed: Expected -5635841, got 0 image.c:6296: Test failed: bits don't match metafile.c:292: Test failed: fillrect playback.2: GdipPlayMetafileRecord failed with stat 3 metafile.c:1138: Test failed: Expected -16776961, got 00000000 metafile.c:292: Test failed: fillrect playback.2: GdipPlayMetafileRecord failed with stat 3 metafile.c:1147: Test failed: Expected -16776961, got 00000000 metafile.c:1166: Test failed: Expected -16776961, got 00000000 metafile.c:1243: Test failed: Expected -00000256, got -16777216 metafile.c:292: Test failed: pagetransform playback.2: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: pagetransform playback.4: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: pagetransform playback.6: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: pagetransform playback.8: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: pagetransform playback.10: GdipPlayMetafileRecord failed with stat 3 metafile.c:1610: Test failed: Expected -16776961, got 00000000 metafile.c:1614: Test failed: Expected -16711936, got 00000000 metafile.c:1618: Test failed: Expected -16711681, got 00000000 metafile.c:1622: Test failed: Expected -00065536, got 00000000 metafile.c:1626: Test failed: Expected -00065281, got 00000000 metafile.c:292: Test failed: worldtransform playback.2: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.4: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.6: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.8: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.10: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.12: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: worldtransform playback.14: GdipPlayMetafileRecord failed with stat 3 metafile.c:1882: Test failed: Expected -16776961, got 00000000 metafile.c:1886: Test failed: Expected -16711936, got 00000000 metafile.c:1890: Test failed: Expected -16711681, got 00000000 metafile.c:1894: Test failed: Expected -00065536, got 00000000 metafile.c:1898: Test failed: Expected -00065281, got 00000000 metafile.c:1902: Test failed: Expected -00000256, got 00000000 metafile.c:1906: Test failed: Expected -00000001, got 00000000 metafile.c:292: Test failed: container playback.4: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: container playback.7: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: container playback.15: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: container playback.17: GdipPlayMetafileRecord failed with stat 3 metafile.c:2239: Test failed: Expected -16777216, got 00000000 metafile.c:2243: Test failed: Expected -16776961, got 00000000 metafile.c:2247: Test failed: Expected -16711936, got 00000000 metafile.c:2251: Test failed: Expected -16711681, got 00000000 metafile.c:292: Test failed: clipping playback.4: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: clipping playback.7: GdipPlayMetafileRecord failed with stat 3 metafile.c:2381: Test failed: Expected -16777216, got 00000000 metafile.c:2385: Test failed: Expected -16776961, got 00000000 metafile.c:292: Test failed: lineargradient playback.3: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: lineargradient playback.5: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: lineargradient playback.7: GdipPlayMetafileRecord failed with stat 3 metafile.c:292: Test failed: lineargradient playback.9: GdipPlayMetafileRecord failed with stat 3 metafile.c:3434: Test failed: Expected -00065536, got 00000000 metafile.c:3438: Test failed: Expected -06750106, got 00000000 metafile.c:3443: Test failed: Expected -00065536, got 00000000 metafile.c:3447: Test failed: Expected -06750106, got 00000000 metafile.c:3452: Test failed: Expected -00065536, got 00000000 metafile.c:3456: Test failed: Expected -12123976, got 00000000 metafile.c:3461: Test failed: Expected -00065536, got 00000000 metafile.c:3465: Test failed: Expected -16711936, got 00000000
Build seems to fail because of some warns but I suppose this shouldn't be a problem because I am mostly only proposing an idea.
This seems worse than I would have expected but I hope someone can comment on this idea.
This merge request was closed by Esme Povirk.
PathToRegion isn't going to do any better. It's the conversion to HRGN that's the problem, not GdipGetRegionHrgn specifically.
Having gdi32 draw to a temporary black and white DIB might actually work, but I'm not sure it's any better than gdiplus doing the conversion itself.
I think that if we use gdi32 to draw a path to an HDC that has some fixed bounds, it'll calculate only the parts of the path that are within those bounds. So if our HDC is limited to the bounds of the Graphics object we're drawing to, we should be able to take advantage of that optimization.
We could then use `BitBlt` with various ROP constants to combine paths.
Looks to me like we specifically have to use `PolyPolygon` to take advantage of the optimization in gdi32.