Nikolay Sivov : gdiplus/metafile: Support hatch brushes for recording.
Alexandre Julliard
julliard at winehq.org
Thu Nov 2 17:28:49 CDT 2017
Module: wine
Branch: master
Commit: f25f0fa2ac47af177de8ea7ef3a476b2b78a4941
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f25f0fa2ac47af177de8ea7ef3a476b2b78a4941
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu Nov 2 14:10:41 2017 +0300
gdiplus/metafile: Support hatch brushes for recording.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/metafile.c | 40 ++++++++++++++++++++++++++++++----------
1 file changed, 30 insertions(+), 10 deletions(-)
diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c
index 0630779..8e9ad87 100644
--- a/dlls/gdiplus/metafile.c
+++ b/dlls/gdiplus/metafile.c
@@ -3752,25 +3752,45 @@ static GpStatus METAFILE_AddPathObject(GpMetafile *metafile, GpPath *path, DWORD
static GpStatus METAFILE_PrepareBrushData(GpBrush *brush, DWORD *size)
{
- if (brush->bt == BrushTypeSolidColor)
+ switch (brush->bt)
{
- *size = FIELD_OFFSET(EmfPlusBrush, BrushData.solid) + sizeof(EmfPlusSolidBrushData);
- return Ok;
+ case BrushTypeSolidColor:
+ *size = FIELD_OFFSET(EmfPlusBrush, BrushData) + sizeof(EmfPlusSolidBrushData);
+ break;
+ case BrushTypeHatchFill:
+ *size = FIELD_OFFSET(EmfPlusBrush, BrushData) + sizeof(EmfPlusHatchBrushData);
+ break;
+ default:
+ FIXME("unsupported brush type: %d\n", brush->bt);
+ return NotImplemented;
}
- FIXME("unsupported brush type: %d\n", brush->bt);
- return NotImplemented;
+ return Ok;
}
static void METAFILE_FillBrushData(GpBrush *brush, EmfPlusBrush *data)
{
- if (brush->bt == BrushTypeSolidColor)
- {
- GpSolidFill *solid = (GpSolidFill*)brush;
+ data->Version = VERSION_MAGIC2;
+ data->Type = brush->bt;
- data->Version = VERSION_MAGIC2;
- data->Type = solid->brush.bt;
+ switch (brush->bt)
+ {
+ case BrushTypeSolidColor:
+ {
+ GpSolidFill *solid = (GpSolidFill *)brush;
data->BrushData.solid.SolidColor = solid->color;
+ break;
+ }
+ case BrushTypeHatchFill:
+ {
+ GpHatch *hatch = (GpHatch *)brush;
+ data->BrushData.hatch.HatchStyle = hatch->hatchstyle;
+ data->BrushData.hatch.ForeColor = hatch->forecol;
+ data->BrushData.hatch.BackColor = hatch->backcol;
+ break;
+ }
+ default:
+ FIXME("unsupported brush type: %d\n", brush->bt);
}
}
More information about the wine-cvs
mailing list