Nikolay Sivov : gdiplus: Implement GdipTranslatePenTransform.
Alexandre Julliard
julliard at winehq.org
Tue Jun 26 04:44:26 CDT 2018
Module: wine
Branch: stable
Commit: 538ec6418bda2b10b7c87385d879ced9edfcb8dc
URL: https://source.winehq.org/git/wine.git/?a=commit;h=538ec6418bda2b10b7c87385d879ced9edfcb8dc
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sat Mar 24 16:10:12 2018 +0300
gdiplus: Implement GdipTranslatePenTransform.
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>
(cherry picked from commit b809b19f84d983fccb51c1e3cff72b086b29ea4f)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/gdiplus/pen.c | 7 +------
dlls/gdiplus/tests/pen.c | 32 ++++++++++++++++++++++++++++++++
include/gdiplusflat.h | 1 +
3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
index 2c49371..b86808b 100644
--- a/dlls/gdiplus/pen.c
+++ b/dlls/gdiplus/pen.c
@@ -460,17 +460,12 @@ GpStatus WINGDIPAPI GdipGetPenTransform(GpPen *pen, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy, GpMatrixOrder order)
{
- static int calls;
-
TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, dx, dy, order);
if(!pen)
return InvalidParameter;
- if(!(calls++))
- FIXME("not implemented\n");
-
- return NotImplemented;
+ return GdipTranslateMatrix(&pen->transform, dx, dy, order);
}
GpStatus WINGDIPAPI GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy, GpMatrixOrder order)
diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c
index ded6e64..be3d76d6 100644
--- a/dlls/gdiplus/tests/pen.c
+++ b/dlls/gdiplus/tests/pen.c
@@ -431,6 +431,38 @@ static void test_transform(void)
expectf(6.0, values[4]);
expectf(3.0, values[5]);
+ /* Translate */
+ status = GdipTranslatePenTransform(NULL, 1.0, -2.0, MatrixOrderAppend);
+ expect(InvalidParameter, status);
+
+ status = GdipTranslatePenTransform(pen, 1.0, -2.0, MatrixOrderAppend);
+ expect(Ok, status);
+
+ status = GdipGetPenTransform(pen, matrix);
+ expect(Ok, status);
+ status = GdipGetMatrixElements(matrix, values);
+ expect(Ok, status);
+ expectf(3.0, values[0]);
+ expectf(-2.0, values[1]);
+ expectf(5.0, values[2]);
+ expectf(2.0, values[3]);
+ expectf(7.0, values[4]);
+ expectf(1.0, values[5]);
+
+ status = GdipTranslatePenTransform(pen, -3.0, 5.0, MatrixOrderPrepend);
+ expect(Ok, status);
+
+ status = GdipGetPenTransform(pen, matrix);
+ expect(Ok, status);
+ status = GdipGetMatrixElements(matrix, values);
+ expect(Ok, status);
+ expectf(3.0, values[0]);
+ expectf(-2.0, values[1]);
+ expectf(5.0, values[2]);
+ expectf(2.0, values[3]);
+ expectf(23.0, values[4]);
+ expectf(17.0, values[5]);
+
status = GdipResetPenTransform(pen);
expect(Ok, status);
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 8bfe8b8..f766441 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -655,6 +655,7 @@ GpStatus WINGDIPAPI GdipGetPenMiterLimit(GpPen*,REAL*);
GpStatus WINGDIPAPI GdipGetPenStartCap(GpPen*,GpLineCap*);
GpStatus WINGDIPAPI GdipGetPenUnit(GpPen*,GpUnit*);
GpStatus WINGDIPAPI GdipGetPenWidth(GpPen*,REAL*);
+GpStatus WINGDIPAPI GdipTranslatePenTransform(GpPen*,REAL,REAL,GpMatrixOrder);
/* Region */
GpStatus WINGDIPAPI GdipCloneRegion(GpRegion *, GpRegion **);
More information about the wine-cvs
mailing list