Evan Stade : gdiplus: Added GdipTransformMatrixPoints.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jul 12 08:32:37 CDT 2007


Module: wine
Branch: master
Commit: 47a605ef9bd2bae60ba74d5f60a2bd1792dfab9e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=47a605ef9bd2bae60ba74d5f60a2bd1792dfab9e

Author: Evan Stade <estade at gmail.com>
Date:   Wed Jul 11 18:07:52 2007 -0700

gdiplus: Added GdipTransformMatrixPoints.

---

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/matrix.c     |   21 +++++++++++++++++++++
 include/gdiplusflat.h     |    1 +
 3 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index b349e01..5879360 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -582,7 +582,7 @@
 @ stub GdipStringFormatGetGenericDefault
 @ stub GdipStringFormatGetGenericTypographic
 @ stub GdipTestControl
-@ stub GdipTransformMatrixPoints
+@ stdcall GdipTransformMatrixPoints(ptr ptr long)
 @ stub GdipTransformMatrixPointsI
 @ stub GdipTransformPath
 @ stub GdipTransformPoints
diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c
index 919e1d4..909bfee 100644
--- a/dlls/gdiplus/matrix.c
+++ b/dlls/gdiplus/matrix.c
@@ -56,3 +56,24 @@ GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
 
     return Ok;
 }
+
+GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
+                                              INT count)
+{
+    REAL x, y;
+    INT i;
+
+    if(!matrix || !pts)
+        return InvalidParameter;
+
+    for(i = 0; i < count; i++)
+    {
+        x = pts[i].X;
+        y = pts[i].Y;
+
+        pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2] + matrix->matrix[4];
+        pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3] + matrix->matrix[5];
+    }
+
+    return Ok;
+}
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 5a48fdc..9185fd5 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -62,6 +62,7 @@ GpStatus WINGDIPAPI GdipStartPathFigure(GpPath*);
 
 GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**);
 GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix*);
+GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix*,GpPointF*,INT);
 
 #ifdef __cplusplus
 }




More information about the wine-cvs mailing list