Jacek Caban : gdi32: Use NtGdiPolyPolyDraw for CreatePolyPolygonRgn implementation.

Alexandre Julliard julliard at winehq.org
Fri Jul 23 18:08:00 CDT 2021


Module: wine
Branch: master
Commit: 607733af0e02312e17a72d9bda64ed881207f38b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=607733af0e02312e17a72d9bda64ed881207f38b

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jul 23 10:49:00 2021 +0200

gdi32: Use NtGdiPolyPolyDraw for CreatePolyPolygonRgn implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 );
-}




More information about the wine-cvs mailing list