Nikolay Sivov : gdiplus: Implemented GdipSetClipPath.

Alexandre Julliard julliard at winehq.org
Tue Sep 30 11:16:27 CDT 2008


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Fri Sep 26 22:18:09 2008 +0400

gdiplus: Implemented GdipSetClipPath.

---

 dlls/gdiplus/gdiplus.spec     |    2 +-
 dlls/gdiplus/graphics.c       |   13 +++++++++++++
 dlls/gdiplus/tests/graphics.c |    7 +++++++
 include/gdiplusflat.h         |    1 +
 4 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 0faf01b..7244a81 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -508,7 +508,7 @@
 @ stdcall GdipSetAdjustableArrowCapWidth(ptr long)
 @ stub GdipSetClipGraphics
 @ stub GdipSetClipHrgn
-@ stub GdipSetClipPath
+@ stdcall GdipSetClipPath(ptr ptr long)
 @ stdcall GdipSetClipRect(ptr long long long long long)
 @ stdcall GdipSetClipRectI(ptr long long long long long)
 @ stdcall GdipSetClipRegion(ptr ptr long)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index b36e31c..3b5d8f0 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -2948,6 +2948,19 @@ GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics *graphics, REAL dx,
     return GdipTranslateMatrix(graphics->worldtrans, dx, dy, order);
 }
 
+GpStatus WINGDIPAPI GdipSetClipPath(GpGraphics *graphics, GpPath *path, CombineMode mode)
+{
+    TRACE("(%p, %p, %d)\n", graphics, path, mode);
+
+    if(!graphics)
+        return InvalidParameter;
+
+    if(graphics->busy)
+        return ObjectBusy;
+
+    return GdipCombineRegionPath(graphics->clip, path, mode);
+}
+
 GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y,
                                     REAL width, REAL height,
                                     CombineMode mode)
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index c000843..6f38446 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -706,6 +706,8 @@ static void test_Get_Release_DC(void)
     expect(ObjectBusy, status); status = Ok;
     status = GdipTranslateWorldTransform(graphics, 0.0, 0.0, MatrixOrderPrepend);
     expect(ObjectBusy, status); status = Ok;
+    status = GdipSetClipPath(graphics, path, CombineModeReplace);
+    expect(ObjectBusy, status); status = Ok;
     status = GdipSetClipRect(graphics, 0.0, 0.0, 10.0, 10.0, CombineModeReplace);
     expect(ObjectBusy, status); status = Ok;
     status = GdipSetClipRectI(graphics, 0, 0, 10, 10, CombineModeReplace);
@@ -804,6 +806,11 @@ static void test_get_set_clip(void)
     status = GdipSetClipRegion(graphics, NULL, CombineModeReplace);
     expect(InvalidParameter, status);
 
+    status = GdipSetClipPath(NULL, NULL, CombineModeReplace);
+    expect(InvalidParameter, status);
+    status = GdipSetClipPath(graphics, NULL, CombineModeReplace);
+    expect(InvalidParameter, status);
+
     res = FALSE;
     status = GdipGetClip(graphics, clip);
     expect(Ok, status);
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index efef67c..7b36a73 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -533,6 +533,7 @@ GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *, INT, INT);
 
 GpStatus WINGDIPAPI GdipFlush(GpGraphics*, GpFlushIntention);
 GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile*,UINT);
+GpStatus WINGDIPAPI GdipSetClipPath(GpGraphics*,GpPath*,CombineMode);
 GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics*,REAL,REAL,REAL,REAL,CombineMode);
 GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics*,INT,INT,INT,INT,CombineMode);
 GpStatus WINGDIPAPI GdipFillRegion(GpGraphics*,GpBrush*,GpRegion*);




More information about the wine-cvs mailing list