Commit 8191ed86 authored by Shawn M. Chapla's avatar Shawn M. Chapla Committed by Alexandre Julliard

gdiplus: Add FillRegion record deserialization.

parent 5ccd10fc
......@@ -563,6 +563,16 @@ typedef struct EmfPlusDrawDriverString
BYTE VariableData[1];
} EmfPlusDrawDriverString;
typedef struct EmfPlusFillRegion
{
EmfPlusRecordHeader Header;
union
{
DWORD BrushId;
EmfPlusARGB Color;
} data;
} EmfPlusFillRegion;
static void metafile_free_object_table_entry(GpMetafile *metafile, BYTE id)
{
struct emfplus_object *object = &metafile->objtable[id];
......@@ -3438,6 +3448,42 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile,
return stat;
}
case EmfPlusRecordTypeFillRegion:
{
EmfPlusFillRegion * const fill = (EmfPlusFillRegion*)header;
GpSolidFill *solidfill = NULL;
GpBrush *brush;
BYTE region = flags & 0xff;
if (dataSize != sizeof(EmfPlusFillRegion) - sizeof(EmfPlusRecordHeader))
return InvalidParameter;
if (region >= EmfPlusObjectTableSize ||
real_metafile->objtable[region].type != ObjectTypeRegion)
return InvalidParameter;
if (flags & 0x8000)
{
stat = GdipCreateSolidFill(fill->data.Color, &solidfill);
if (stat != Ok)
return stat;
brush = (GpBrush*)solidfill;
}
else
{
if (fill->data.BrushId >= EmfPlusObjectTableSize ||
real_metafile->objtable[fill->data.BrushId].type != ObjectTypeBrush)
return InvalidParameter;
brush = real_metafile->objtable[fill->data.BrushId].u.brush;
}
stat = GdipFillRegion(real_metafile->playback_graphics, brush,
real_metafile->objtable[region].u.region);
GdipDeleteBrush((GpBrush*)solidfill);
return stat;
}
default:
FIXME("Not implemented for record type %x\n", recordType);
return NotImplemented;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment