[v2 PATCH 2/5] gdiplus/metafile: Support hatch brushes in playback

Nikolay Sivov nsivov at codeweavers.com
Thu Nov 2 06:10:39 CDT 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/gdiplus/metafile.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c
index bf07fed983..c9ddcc674a 100644
--- a/dlls/gdiplus/metafile.c
+++ b/dlls/gdiplus/metafile.c
@@ -230,12 +230,20 @@ typedef struct EmfPlusSolidBrushData
     EmfPlusARGB SolidColor;
 } EmfPlusSolidBrushData;
 
+typedef struct EmfPlusHatchBrushData
+{
+    DWORD HatchStyle;
+    EmfPlusARGB ForeColor;
+    EmfPlusARGB BackColor;
+} EmfPlusHatchBrushData;
+
 typedef struct EmfPlusBrush
 {
     DWORD Version;
     DWORD Type;
     union {
         EmfPlusSolidBrushData solid;
+        EmfPlusHatchBrushData hatch;
     } BrushData;
 } EmfPlusBrush;
 
@@ -1833,6 +1841,13 @@ static GpStatus metafile_deserialize_brush(const BYTE *record_data, UINT data_si
 
         status = GdipCreateSolidFill(data->BrushData.solid.SolidColor, (GpSolidFill **)brush);
         break;
+    case BrushTypeHatchFill:
+        if (data_size != header_size + sizeof(EmfPlusHatchBrushData))
+            return InvalidParameter;
+
+        status = GdipCreateHatchBrush(data->BrushData.hatch.HatchStyle, data->BrushData.hatch.ForeColor,
+            data->BrushData.hatch.BackColor, (GpHatch **)brush);
+        break;
     default:
         FIXME("brush type %u is not supported.\n", data->Type);
         return NotImplemented;
-- 
2.14.2




More information about the wine-patches mailing list