From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/tests/pen.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index 874344e9c04..1ac74123877 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -445,9 +445,10 @@ static void test_transform(void) { GpStatus status; GpPen *pen; - GpMatrix *matrix, *matrix2; + GpMatrix *matrix, *matrix2, *not_invertible_matrix; REAL values[6];
+ /* Check default Pen Transformation */ status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); expect(Ok, status);
@@ -467,6 +468,26 @@ static void test_transform(void) expectf(0.0, values[4]); expectf(0.0, values[5]);
+ /* Setting Pen Tranformation to Not invertible matrix, should return InvalidParameter */ + GdipCreateMatrix2(3.0, 3.0, 2.0, 2.0, 6.0, 3.0, ¬_invertible_matrix); + + status = GdipSetPenTransform(pen, not_invertible_matrix); + todo_wine expect(InvalidParameter, status); + GdipDeleteMatrix(not_invertible_matrix); + + status = GdipGetPenTransform(pen, matrix); + expect(Ok, status); + status = GdipGetMatrixElements(matrix, values); + expect(Ok, status); + + todo_wine expectf(1.0, values[0]); + todo_wine expectf(0.0, values[1]); + todo_wine expectf(0.0, values[2]); + todo_wine expectf(1.0, values[3]); + todo_wine expectf(0.0, values[4]); + todo_wine expectf(0.0, values[5]); + + /* Setting Pen Tranformation to invertible matrix, should be successfull */ GdipCreateMatrix2(3.0, -2.0, 5.0, 2.0, 6.0, 3.0, &matrix2); status = GdipSetPenTransform(pen, matrix2); expect(Ok, status);
From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/pen.c | 10 +++++----- dlls/gdiplus/tests/pen.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index fac31d6e84e..2776a8f5619 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -444,16 +444,16 @@ GpStatus WINGDIPAPI GdipResetPenTransform(GpPen *pen)
GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix) { - static int calls; + BOOL result;
- TRACE("(%p,%s)\n", pen, debugstr_matrix(matrix)); + TRACE("(%p, %s)\n", pen, debugstr_matrix(matrix));
if(!pen || !matrix) return InvalidParameter;
- if(!(calls++)) - FIXME("(%p,%p) Semi-stub\n", pen, matrix); - + GdipIsMatrixInvertible(matrix, &result); + if (!result) + return InvalidParameter; pen->transform = *matrix;
return Ok; diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index 1ac74123877..445f2dbb5b8 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -472,7 +472,7 @@ static void test_transform(void) GdipCreateMatrix2(3.0, 3.0, 2.0, 2.0, 6.0, 3.0, ¬_invertible_matrix);
status = GdipSetPenTransform(pen, not_invertible_matrix); - todo_wine expect(InvalidParameter, status); + expect(InvalidParameter, status); GdipDeleteMatrix(not_invertible_matrix);
status = GdipGetPenTransform(pen, matrix); @@ -480,12 +480,12 @@ static void test_transform(void) status = GdipGetMatrixElements(matrix, values); expect(Ok, status);
- todo_wine expectf(1.0, values[0]); - todo_wine expectf(0.0, values[1]); - todo_wine expectf(0.0, values[2]); - todo_wine expectf(1.0, values[3]); - todo_wine expectf(0.0, values[4]); - todo_wine expectf(0.0, values[5]); + expectf(1.0, values[0]); + expectf(0.0, values[1]); + expectf(0.0, values[2]); + expectf(1.0, values[3]); + expectf(0.0, values[4]); + expectf(0.0, values[5]);
/* Setting Pen Tranformation to invertible matrix, should be successfull */ GdipCreateMatrix2(3.0, -2.0, 5.0, 2.0, 6.0, 3.0, &matrix2);
Esme Povirk (@madewokherd) commented about dlls/gdiplus/pen.c:
GpStatus WINGDIPAPI GdipSetPenTransform(GpPen *pen, GpMatrix *matrix) {
- static int calls;
BOOL result;
TRACE("(%p, %s)\n", pen, debugstr_matrix(matrix));
if(!pen || !matrix) return InvalidParameter;
- if(!(calls++))
FIXME("(%p,%p) Semi-stub\n", pen, matrix);
- GdipIsMatrixInvertible(matrix, &result);
- if (!result)
return InvalidParameter;
This is still a stub, isn't it? My understanding is that the transform is supposed to affect rendering, and it currently doesn't.