Jacek Caban : gdi32: Use NtGdiArcInternal for Arc implementation.

Alexandre Julliard julliard at winehq.org
Mon Jul 19 15:59:15 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sat Jul 17 16:56:54 2021 +0200

gdi32: Use NtGdiArcInternal for Arc 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/gdidc.c    | 12 ++++++++++++
 dlls/gdi32/painting.c | 27 +++++++++++++++++----------
 include/ntgdi.h       |  8 ++++++++
 3 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c
index 33adb8ccf82..2fc74d7685b 100644
--- a/dlls/gdi32/gdidc.c
+++ b/dlls/gdi32/gdidc.c
@@ -42,3 +42,15 @@ BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, POINT *pt )
     TRACE( "%p, (%d, %d), %p\n", hdc, x, y, pt );
     return NtGdiMoveTo( hdc, x, y, pt );
 }
+
+/***********************************************************************
+ *           Arc    (GDI32.@)
+ */
+BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right, INT bottom,
+                 INT xstart, INT ystart, INT xend, INT yend )
+{
+    TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top,
+           right, bottom, xstart, ystart, xend, yend );
+    return NtGdiArcInternal( NtGdiArc, hdc, left, top, right, bottom,
+                             xstart, ystart, xend, yend );
+}
diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c
index 85c940c7f3d..b235480dacb 100644
--- a/dlls/gdi32/painting.c
+++ b/dlls/gdi32/painting.c
@@ -275,22 +275,29 @@ BOOL WINAPI NtGdiMoveTo( HDC hdc, INT x, INT y, POINT *pt )
 
 
 /***********************************************************************
- *           Arc    (GDI32.@)
+ *           NtGdiArcInternal    (win32u.@)
  */
-BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right,
-                     INT bottom, INT xstart, INT ystart,
-                     INT xend, INT yend )
+BOOL WINAPI NtGdiArcInternal( UINT type, HDC hdc, INT left, INT top, INT right,
+                              INT bottom, INT xstart, INT ystart, INT xend, INT yend )
 {
     PHYSDEV physdev;
     BOOL ret;
-    DC * dc = get_dc_ptr( hdc );
-
-    TRACE( "%p, (%d, %d)-(%d, %d), (%d, %d), (%d, %d)\n", hdc, left, top, right, bottom, xstart, ystart, xend, yend );
+    DC *dc;
 
-    if (!dc) return FALSE;
+    if (!(dc = get_dc_ptr( hdc ))) return FALSE;
     update_dc( dc );
-    physdev = GET_DC_PHYSDEV( dc, pArc );
-    ret = physdev->funcs->pArc( physdev, left, top, right, bottom, xstart, ystart, xend, yend );
+
+    switch (type)
+    {
+    case NtGdiArc:
+        physdev = GET_DC_PHYSDEV( dc, pArc );
+        ret = physdev->funcs->pArc( physdev, left, top, right, bottom, xstart, ystart, xend, yend );
+        break;
+    default:
+        WARN( "invalid arc type %u\n", type );
+        ret = FALSE;
+    }
+
     release_dc_ptr( dc );
     return ret;
 }
diff --git a/include/ntgdi.h b/include/ntgdi.h
index d8adc327548..d90529392d5 100644
--- a/include/ntgdi.h
+++ b/include/ntgdi.h
@@ -72,6 +72,14 @@ typedef struct _GDI_SHARED_MEMORY
     GDI_HANDLE_ENTRY Handles[GDI_MAX_HANDLE_COUNT];
 } GDI_SHARED_MEMORY, *PGDI_SHARED_MEMORY;
 
+enum
+{
+    NtGdiArc,
+    NtGdiArcTo,
+    NtGdiChord,
+    NtGdiPie,
+};
+
 INT      WINAPI NtGdiAbortDoc( HDC hdc );
 BOOL     WINAPI NtGdiAbortPath( HDC hdc );
 BOOL     WINAPI NtGdiAngleArc( HDC hdc, INT x, INT y, DWORD radius, FLOAT start_angle,




More information about the wine-cvs mailing list