[PATCH 1/3] gdiplus: Implement GdipGetPenTransform

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Fri Jan 29 03:49:19 CST 2016


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/gdiplus/gdiplus_private.h | 6 ++++++
 dlls/gdiplus/pen.c             | 9 ++++-----
 dlls/gdiplus/tests/pen.c       | 6 +++---
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index 1af0bd0..1ed1e5e 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -71,6 +71,11 @@ static inline BOOL heap_free(void *mem)
     return HeapFree(GetProcessHeap(), 0, mem);
 }
 
+static inline void copy_matrix(GpMatrix *in, GpMatrix *out)
+{
+    memcpy(out, in, 6 * sizeof(REAL));
+}
+
 COLORREF ARGB2COLORREF(ARGB color) DECLSPEC_HIDDEN;
 HBITMAP ARGB2BMP(ARGB color) DECLSPEC_HIDDEN;
 extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2,
@@ -197,6 +202,7 @@ struct GpPen{
     REAL offset;    /* dash offset */
     GpBrush *brush;
     GpPenAlignment align;
+    GpMatrix *transform;
 };
 
 struct GpGraphics{
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
index f7dacef..adac25e 100644
--- a/dlls/gdiplus/pen.c
+++ b/dlls/gdiplus/pen.c
@@ -171,6 +171,7 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
     gp_pen->offset = 0.0;
     gp_pen->customstart = NULL;
     gp_pen->customend = NULL;
+    GdipCreateMatrix(&gp_pen->transform);
 
     if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
         FIXME("UnitWorld, UnitPixel only supported units\n");
@@ -197,6 +198,7 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
     GdipDeleteBrush(pen->brush);
     GdipDeleteCustomLineCap(pen->customstart);
     GdipDeleteCustomLineCap(pen->customend);
+    GdipDeleteMatrix(pen->transform);
     heap_free(pen->dashes);
     heap_free(pen);
 
@@ -448,17 +450,14 @@ GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix)
 
 GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *pen, GpMatrix *matrix)
 {
-    static int calls;
-
     TRACE("(%p,%p)\n", pen, matrix);
 
     if(!pen || !matrix)
         return InvalidParameter;
 
-    if(!(calls++))
-        FIXME("not implemented\n");
+    copy_matrix(pen->transform, matrix);
 
-    return NotImplemented;
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order)
diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c
index 6eee2ea..1e63560 100644
--- a/dlls/gdiplus/tests/pen.c
+++ b/dlls/gdiplus/tests/pen.c
@@ -380,7 +380,7 @@ static void test_transform(void)
     expect(Ok, status);
 
     status = GdipGetPenTransform(pen, matrix);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
 
     status = GdipGetMatrixElements(matrix, values);
     expect(Ok, status);
@@ -398,7 +398,7 @@ static void test_transform(void)
     GdipDeleteMatrix(matrix2);
 
     status = GdipGetPenTransform(pen, matrix);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     status = GdipGetMatrixElements(matrix, values);
     expect(Ok, status);
 todo_wine {
@@ -413,7 +413,7 @@ todo_wine {
     todo_wine expect(Ok, status);
 
     status = GdipGetPenTransform(pen, matrix);
-    todo_wine expect(Ok, status);
+    expect(Ok, status);
     status = GdipGetMatrixElements(matrix, values);
     expect(Ok, status);
 
-- 
1.9.1




More information about the wine-patches mailing list