Module: wine Branch: master Commit: 3aa94d33e488f4437de85d8abc386371caddc681 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3aa94d33e488f4437de85d8abc...
Author: Nikolay Sivov bunglehead@gmail.com Date: Thu Apr 24 20:47:52 2008 +0400
gdiplus: Implemented GdipTransformMatrixPointsI.
---
dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/matrix.c | 27 +++++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index e301f57..14f600a 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -604,7 +604,7 @@ @ stub GdipStringFormatGetGenericTypographic @ stub GdipTestControl @ stdcall GdipTransformMatrixPoints(ptr ptr long) -@ stub GdipTransformMatrixPointsI +@ stdcall GdipTransformMatrixPointsI(ptr ptr long) @ stdcall GdipTransformPath(ptr ptr) @ stub GdipTransformPoints @ stub GdipTransformPointsI diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index e80031f..e04e2cd 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -259,6 +259,33 @@ GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, return Ok; }
+GpStatus WINGDIPAPI GdipTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count) +{ + GpPointF *ptsF; + GpStatus ret; + INT i; + + ptsF = GdipAlloc(sizeof(GpPointF) * count); + if(!ptsF) + return OutOfMemory; + + for(i = 0; i < count; i++){ + ptsF[i].X = (REAL)pts[i].X; + ptsF[i].Y = (REAL)pts[i].Y; + } + + ret = GdipTransformMatrixPoints(matrix, ptsF, count); + + if(ret == Ok) + for(i = 0; i < count; i++){ + pts[i].X = roundr(ptsF[i].X); + pts[i].Y = roundr(ptsF[i].Y); + } + GdipFree(ptsF); + + return ret; +} + GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 5765795..ba2c6ee 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -229,6 +229,7 @@ GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix*,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix*,GpPointF*,INT); +GpStatus WINGDIPAPI GdipTransformMatrixPointsI(GpMatrix*,GpPoint*,INT); GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(GpMatrix*,GpPointF*,INT); GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI(GpMatrix*,GpPoint*,INT); GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder);