Shawn M. Chapla : gdi32: Implement EMR_POLYDRAW16 playback.

Alexandre Julliard julliard at winehq.org
Thu Aug 27 15:26:49 CDT 2020


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

Author: Shawn M. Chapla <schapla at codeweavers.com>
Date:   Wed Aug 26 19:21:43 2020 -0400

gdi32: Implement EMR_POLYDRAW16 playback.

Signed-off-by: Shawn M. Chapla <schapla at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/enhmetafile.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c
index 4d6531644b..666828db1f 100644
--- a/dlls/gdi32/enhmetafile.c
+++ b/dlls/gdi32/enhmetafile.c
@@ -1143,6 +1143,31 @@ BOOL WINAPI PlayEnhMetaFileRecord(
 	break;
       }
 
+    case EMR_POLYDRAW16:
+    {
+        const EMRPOLYDRAW16 *pPolyDraw16 = (const EMRPOLYDRAW16 *)mr;
+        const POINTS *ptl = pPolyDraw16->apts;
+        POINT *pts = HeapAlloc(GetProcessHeap(), 0, pPolyDraw16->cpts * sizeof(POINT));
+        DWORD i;
+
+        /* NB abTypes array doesn't start at pPolyDraw16->abTypes. It's actually
+           pPolyDraw16->apts + pPolyDraw16->cpts. */
+        const BYTE *types = (BYTE*)(pPolyDraw16->apts + pPolyDraw16->cpts);
+
+        if (!pts)
+            break;
+
+        for (i = 0; i < pPolyDraw16->cpts; ++i)
+        {
+            pts[i].x = ptl[i].x;
+            pts[i].y = ptl[i].y;
+        }
+
+        PolyDraw(hdc, pts, types, pPolyDraw16->cpts);
+        HeapFree(GetProcessHeap(), 0, pts);
+        break;
+    }
+
     case EMR_STRETCHDIBITS:
       {
 	const EMRSTRETCHDIBITS *pStretchDIBits = (const EMRSTRETCHDIBITS *)mr;
@@ -2243,7 +2268,6 @@ BOOL WINAPI PlayEnhMetaFileRecord(
         break;
     }
 
-    case EMR_POLYDRAW16:
     case EMR_GLSRECORD:
     case EMR_GLSBOUNDEDRECORD:
     case EMR_DRAWESCAPE:




More information about the wine-cvs mailing list