Piotr Caban : gdiplus: Support GdipSetTextRenderingHint in metafiles.
Alexandre Julliard
julliard at winehq.org
Tue Jul 11 15:59:32 CDT 2017
Module: wine
Branch: master
Commit: 683315d111f99c527ae04391634e3f41e685cb08
URL: http://source.winehq.org/git/wine.git/?a=commit;h=683315d111f99c527ae04391634e3f41e685cb08
Author: Piotr Caban <piotr at codeweavers.com>
Date: Tue Jul 11 10:58:58 2017 +0200
gdiplus: Support GdipSetTextRenderingHint in metafiles.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/gdiplus_private.h | 1 +
dlls/gdiplus/graphics.c | 12 ++++++++++++
dlls/gdiplus/metafile.c | 18 ++++++++++++++++++
3 files changed, 31 insertions(+)
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index 6fd0968..f24f38e 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -110,6 +110,7 @@ extern GpStatus METAFILE_DrawImagePointsRect(GpMetafile* metafile, GpImage *imag
GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth,
REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes,
DrawImageAbort callback, VOID *callbackData) DECLSPEC_HIDDEN;
+extern GpStatus METAFILE_AddSimpleProperty(GpMetafile *metafile, SHORT prop, SHORT val) DECLSPEC_HIDDEN;
extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1,
REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN;
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 7ef0d11..7a6fcb1 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -5987,6 +5987,18 @@ GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics *graphics,
if(graphics->busy)
return ObjectBusy;
+ if(graphics->texthint == hint)
+ return Ok;
+
+ if(graphics->image && graphics->image->type == ImageTypeMetafile) {
+ GpStatus stat;
+
+ stat = METAFILE_AddSimpleProperty((GpMetafile*)graphics->image,
+ EmfPlusRecordTypeSetTextRenderingHint, hint);
+ if(stat != Ok)
+ return stat;
+ }
+
graphics->texthint = hint;
return Ok;
diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c
index 1aafdf7..df87a66 100644
--- a/dlls/gdiplus/metafile.c
+++ b/dlls/gdiplus/metafile.c
@@ -2551,3 +2551,21 @@ GpStatus METAFILE_DrawImagePointsRect(GpMetafile *metafile, GpImage *image,
METAFILE_WriteRecords(metafile);
return Ok;
}
+
+GpStatus METAFILE_AddSimpleProperty(GpMetafile *metafile, SHORT prop, SHORT val)
+{
+ EmfPlusRecordHeader *record;
+ GpStatus stat;
+
+ if (metafile->metafile_type != MetafileTypeEmfPlusOnly && metafile->metafile_type != MetafileTypeEmfPlusDual)
+ return Ok;
+
+ stat = METAFILE_AllocateRecord(metafile, sizeof(*record), (void**)&record);
+ if (stat != Ok) return stat;
+
+ record->Type = prop;
+ record->Flags = val;
+
+ METAFILE_WriteRecords(metafile);
+ return Ok;
+}
More information about the wine-cvs
mailing list