gdiplus/metafile: Support hatch brushes in playback.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-11-02 14:10:39 +03:00 committed by Alexandre Julliard
parent 0625b33834
commit 6d0ca495b8
1 changed files with 15 additions and 0 deletions

View File

@ -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;