Nikolay Sivov : gdiplus: Implement GdipMultiplyPenTransform().

Alexandre Julliard julliard at winehq.org
Mon Oct 22 15:38:45 CDT 2018


Module: wine
Branch: master
Commit: e52a20f5bf86d156e1130e8268c65e04032e8caa
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e52a20f5bf86d156e1130e8268c65e04032e8caa

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Oct 19 20:02:39 2018 +0300

gdiplus: Implement GdipMultiplyPenTransform().

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/pen.c       |  7 +------
 dlls/gdiplus/tests/pen.c | 35 +++++++++++++++++++++++++++++++++++
 include/gdiplusflat.h    |  1 +
 3 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
index 1f18f3f..ad45bcb 100644
--- a/dlls/gdiplus/pen.c
+++ b/dlls/gdiplus/pen.c
@@ -496,17 +496,12 @@ GpStatus WINGDIPAPI GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder
 GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix,
     GpMatrixOrder order)
 {
-    static int calls;
-
     TRACE("(%p,%p,%u)\n", pen, matrix, order);
 
     if(!pen)
         return InvalidParameter;
 
-    if(!(calls++))
-        FIXME("not implemented\n");
-
-    return NotImplemented;
+    return GdipMultiplyMatrix(&pen->transform, matrix, order);
 }
 
 GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen *pen, GpBrush *brush)
diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c
index 6f69c3b..530967a 100644
--- a/dlls/gdiplus/tests/pen.c
+++ b/dlls/gdiplus/tests/pen.c
@@ -553,6 +553,41 @@ static void test_transform(void)
     expectf(1.0, values[4]);
     expectf(-2.0, values[5]);
 
+    /* Multiply */
+    status = GdipResetPenTransform(pen);
+    expect(Ok, status);
+
+    status = GdipSetMatrixElements(matrix, 2.0, 1.0, 1.0, 4.0, 1.0, 2.0);
+    expect(Ok, status);
+
+    status = GdipMultiplyPenTransform(NULL, matrix, MatrixOrderPrepend);
+    expect(InvalidParameter, status);
+
+    status = GdipMultiplyPenTransform(pen, matrix, MatrixOrderPrepend);
+    expect(Ok, status);
+
+    get_pen_transform(pen, values);
+    expectf(2.0, values[0]);
+    expectf(1.0, values[1]);
+    expectf(1.0, values[2]);
+    expectf(4.0, values[3]);
+    expectf(1.0, values[4]);
+    expectf(2.0, values[5]);
+
+    status = GdipScalePenTransform(pen, 2.0, -10.0, MatrixOrderAppend);
+    expect(Ok, status);
+
+    status = GdipMultiplyPenTransform(pen, matrix, MatrixOrderAppend);
+    expect(Ok, status);
+
+    get_pen_transform(pen, values);
+    expectf(-2.0, values[0]);
+    expectf(-36.0, values[1]);
+    expectf(-36.0, values[2]);
+    expectf(-158.0, values[3]);
+    expectf(-15.0, values[4]);
+    expectf(-76.0, values[5]);
+
     GdipDeletePen(pen);
 
     GdipDeleteMatrix(matrix);
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 628db82..5593ac5 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -629,6 +629,7 @@ GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen*,REAL*);
 GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*);
 GpStatus WINGDIPAPI GdipGetPenMode(GpPen*,GpPenAlignment*);
 GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *, GpMatrix *);
+GpStatus WINGDIPAPI GdipMultiplyPenTransform(GpPen *,GDIPCONST GpMatrix *,GpMatrixOrder);
 GpStatus WINGDIPAPI GdipResetPenTransform(GpPen*);
 GpStatus WINGDIPAPI GdipScalePenTransform(GpPen*,REAL,REAL,GpMatrixOrder);
 GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*);




More information about the wine-cvs mailing list