From 607733af0e02312e17a72d9bda64ed881207f38b Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 23 Jul 2021 10:49:00 +0200 Subject: [PATCH] gdi32: Use NtGdiPolyPolyDraw for CreatePolyPolygonRgn implementation. Signed-off-by: Jacek Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/gdi32/objects.c | 10 ++++++++++ dlls/gdi32/painting.c | 4 ++++ dlls/gdi32/region.c | 9 --------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c index e614a9d6a52..84ed2377954 100644 --- a/dlls/gdi32/objects.c +++ b/dlls/gdi32/objects.c @@ -281,6 +281,16 @@ HRGN WINAPI ExtCreateRegion( const XFORM *xform, DWORD count, const RGNDATA *dat return NtGdiExtCreateRegion( xform, count, data ); } +/*********************************************************************** + * CreatePolyPolygonRgn (GDI32.@) + */ +HRGN WINAPI CreatePolyPolygonRgn( const POINT *points, const INT *counts, INT count, INT mode ) +{ + ULONG ret = NtGdiPolyPolyDraw( ULongToHandle(mode), points, (const UINT *)counts, + count, NtGdiPolyPolygonRgn ); + return ULongToHandle( ret ); +} + /*********************************************************************** * CreateRectRgnIndirect (GDI32.@) * diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index f9fa18c4de0..803b9797736 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -585,6 +585,10 @@ ULONG WINAPI NtGdiPolyPolyDraw( HDC hdc, const POINT *points, const UINT *counts ULONG ret; DC *dc; + if (function == NtGdiPolyPolygonRgn) + return HandleToULong( create_polypolygon_region( points, (const INT *)counts, count, + HandleToULong(hdc), NULL )); + if (!(dc = get_dc_ptr( hdc ))) return FALSE; update_dc( dc ); diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c index 502ce108a8f..4df48209de5 100644 --- a/dlls/gdi32/region.c +++ b/dlls/gdi32/region.c @@ -2692,12 +2692,3 @@ HRGN create_polypolygon_region( const POINT *Pts, const INT *Count, INT nbpolygo HeapFree( GetProcessHeap(), 0, pETEs ); return hrgn; } - - -/*********************************************************************** - * CreatePolyPolygonRgn (GDI32.@) - */ -HRGN WINAPI CreatePolyPolygonRgn( const POINT *pts, const INT *count, INT nbpolygons, INT mode ) -{ - return create_polypolygon_region( pts, count, nbpolygons, mode, NULL ); -}