Jacek Caban : gdi32: Use NtGdiGetRgnBox in emfdrv_stroke_and_fill_path.

Alexandre Julliard julliard at winehq.org
Mon Aug 23 16:24:14 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Aug 23 13:52:40 2021 +0200

gdi32: Use NtGdiGetRgnBox in emfdrv_stroke_and_fill_path.

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/enhmfdrv/graphics.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c
index f63308b579c..0c6d671c7d4 100644
--- a/dlls/gdi32/enhmfdrv/graphics.c
+++ b/dlls/gdi32/enhmfdrv/graphics.c
@@ -94,25 +94,21 @@ static void get_points_bounds( RECTL *bounds, const POINT *pts, UINT count, DC_A
 /* helper for path stroke and fill functions */
 static BOOL emfdrv_stroke_and_fill_path( struct emf *emf, INT type )
 {
-    DC *dc = get_physdev_dc( &emf->dev );
     EMRSTROKEANDFILLPATH emr;
-    struct gdi_path *path;
-    POINT *points;
-    BYTE *flags;
+    HRGN region;
 
     emr.emr.iType = type;
     emr.emr.nSize = sizeof(emr);
+    emr.rclBounds = empty_bounds;
 
-    if ((path = get_gdi_flat_path( dc, NULL )))
+    if ((region = NtGdiPathToRegion( emf->dc_attr->hdc )))
     {
-        int count = get_gdi_path_data( path, &points, &flags );
-        get_points_bounds( &emr.rclBounds, points, count, 0 );
-        free_gdi_path( path );
+        NtGdiGetRgnBox( region, (RECT *)&emr.rclBounds );
+        DeleteObject( region );
     }
-    else emr.rclBounds = empty_bounds;
 
     if (!emfdc_record( emf, &emr.emr )) return FALSE;
-    if (!path) return FALSE;
+    if (!region) return FALSE;
     emfdc_update_bounds( emf, &emr.rclBounds );
     return TRUE;
 }




More information about the wine-cvs mailing list