From 204253b6babd179759a494d17fcb8af857ee5f2c Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 28 Mar 2011 16:40:19 -0500 Subject: [PATCH] gdiplus: Add test for GdipDrawDriverString. --- dlls/gdiplus/tests/graphics.c | 32 ++++++++++++++++++++++++++++++++ include/gdiplusenums.h | 9 +++++++++ 2 files changed, 41 insertions(+) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index bd14ab6ef6a..d42b37ae13c 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -1954,6 +1954,8 @@ static void test_GdipDrawString(void) LOGFONTA logfont; HDC hdc = GetDC( hwnd ); static const WCHAR string[] = {'T','e','s','t',0}; + static const PointF positions[4] = {{0,0}, {1,1}, {2,2}, {3,3}}; + GpMatrix *matrix; memset(&logfont,0,sizeof(logfont)); strcpy(logfont.lfFaceName,"Arial"); @@ -1985,6 +1987,36 @@ static void test_GdipDrawString(void) status = GdipDrawString(graphics, string, 4, fnt, &rect, format, brush); expect(Ok, status); + status = GdipCreateMatrix(&matrix); + expect(Ok, status); + +todo_wine { + status = GdipDrawDriverString(NULL, string, 4, fnt, brush, positions, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, NULL, 4, fnt, brush, positions, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, string, 4, NULL, brush, positions, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, NULL, positions, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, brush, NULL, DriverStringOptionsCmapLookup, matrix); + expect(InvalidParameter, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, brush, positions, DriverStringOptionsCmapLookup|0x10, matrix); + expect(Ok, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, brush, positions, DriverStringOptionsCmapLookup, NULL); + expect(Ok, status); + + status = GdipDrawDriverString(graphics, string, 4, fnt, brush, positions, DriverStringOptionsCmapLookup, matrix); + expect(Ok, status); +} + + GdipDeleteMatrix(matrix); GdipDeleteGraphics(graphics); GdipDeleteBrush(brush); GdipDeleteFont(fnt); diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h index dc03b29c5a1..69c81540ffc 100644 --- a/include/gdiplusenums.h +++ b/include/gdiplusenums.h @@ -42,6 +42,14 @@ enum BrushType BrushTypeLinearGradient = 4 }; +enum DriverStringOptions +{ + DriverStringOptionsCmapLookup = 1, + DriverStringOptionsVertical = 2, + DriverStringOptionsRealizedAdvance = 4, + DriverStringOptionsLimitSubpixel = 4 +}; + enum FillMode { FillModeAlternate = 0, @@ -707,6 +715,7 @@ enum EmfPlusRecordType { typedef enum Unit Unit; typedef enum BrushType BrushType; +typedef enum DriverStringOptions DriverStringOptions; typedef enum FillMode FillMode; typedef enum LineCap LineCap; typedef enum PathPointType PathPointType;