[resend PATCH 4/4] gdiplus/metafile: Implement EmfPlusRecordTypeSetClipRegion playback

Nikolay Sivov nsivov at codeweavers.com
Thu Oct 19 16:45:41 CDT 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/gdiplus/metafile.c       | 13 +++++++++++++
 dlls/gdiplus/tests/metafile.c |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c
index 7289ea56db..59df68d5bb 100644
--- a/dlls/gdiplus/metafile.c
+++ b/dlls/gdiplus/metafile.c
@@ -2703,6 +2703,19 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile,
             return GdipDrawPath(real_metafile->playback_graphics, real_metafile->objtable[draw->PenId].u.pen,
                 real_metafile->objtable[path].u.path);
         }
+        case EmfPlusRecordTypeSetClipRegion:
+        {
+            BYTE region = flags & 0xff;
+
+            if (dataSize != 0)
+                return InvalidParameter;
+
+            if (region >= EmfPlusObjectTableSize || real_metafile->objtable[region].type != ObjectTypeRegion)
+                return InvalidParameter;
+
+            return GdipSetClipRegion(real_metafile->playback_graphics, real_metafile->objtable[region].u.region,
+                (flags >> 8) & 0xf);
+        }
         default:
             FIXME("Not implemented for record type %x\n", recordType);
             return NotImplemented;
diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c
index f23221055c..bd4d5264ed 100644
--- a/dlls/gdiplus/tests/metafile.c
+++ b/dlls/gdiplus/tests/metafile.c
@@ -2171,7 +2171,7 @@ static const emfplus_record clipping_records[] = {
     { EmfPlusRecordTypeSetClipRect, 0x300 },
     { EmfPlusRecordTypeFillRects, 0xc000 },
     { EmfPlusRecordTypeObject, ObjectTypeRegion << 8 },
-    { EmfPlusRecordTypeSetClipRegion, 0x100, 0, 1 },
+    { EmfPlusRecordTypeSetClipRegion, 0x100 },
     { EmfPlusRecordTypeEndOfFile },
     { EMR_EOF },
     { 0 }
-- 
2.14.2




More information about the wine-patches mailing list