[PATCH] gdiplus: Implement GdipMultiplyPenTransform().
Nikolay Sivov
nsivov at codeweavers.com
Fri Oct 19 12:02:39 CDT 2018
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
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 1f18f3f5a3..ad45bcb5d5 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 6f69c3b8b4..530967afb2 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 628db82d45..5593ac51b6 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*);
--
2.19.1
More information about the wine-devel
mailing list