[3/5] gdiplus: Add stub GdipGetPathGradientPath with tests.

Vincent Povirk madewokherd at gmail.com
Mon Mar 12 16:01:26 CDT 2012


-------------- next part --------------
From 89b50e065e8dea039df114d035ec82b4b7c11419 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Mon, 20 Feb 2012 14:02:37 -0600
Subject: [PATCH 03/14] gdiplus: Add stub GdipGetPathGradientPath with tests.

---
 dlls/gdiplus/brush.c       |   12 ++++++++++++
 dlls/gdiplus/gdiplus.spec  |    2 +-
 dlls/gdiplus/tests/brush.c |   29 +++++++++++++++++++++++++++++
 include/gdiplusflat.h      |    1 +
 4 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index dc00a4f..21bec64 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -1030,6 +1030,18 @@ GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(GpPathGradient *grad,
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipGetPathGradientPath(GpPathGradient *grad, GpPath *path)
+{
+    static int calls;
+
+    TRACE("(%p, %p)\n", grad, path);
+
+    if (!(calls++))
+        FIXME("not implemented\n");
+
+    return NotImplemented;
+}
+
 GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient *grad,
     INT *count)
 {
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 9398658..b7d82da 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -316,7 +316,7 @@
 316 stdcall GdipGetPathGradientCenterPointI(ptr ptr)
 317 stdcall GdipGetPathGradientFocusScales(ptr ptr ptr)
 318 stdcall GdipGetPathGradientGammaCorrection(ptr ptr)
-319 stub GdipGetPathGradientPath
+319 stdcall GdipGetPathGradientPath(ptr ptr)
 320 stdcall GdipGetPathGradientPointCount(ptr ptr)
 321 stdcall GdipGetPathGradientPresetBlend(ptr ptr ptr long)
 322 stdcall GdipGetPathGradientPresetBlendCount(ptr ptr)
diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c
index 5eed607..296cf0f 100644
--- a/dlls/gdiplus/tests/brush.c
+++ b/dlls/gdiplus/tests/brush.c
@@ -824,6 +824,34 @@ static void test_gradientsurroundcolorcount(void)
     GdipDeleteBrush((GpBrush*)grad);
 }
 
+static void test_pathgradientpath(void)
+{
+    GpStatus status;
+    GpPath *path=NULL;
+    GpPathGradient *grad=NULL;
+
+    status = GdipCreatePathGradient(blendcount_ptf, 2, WrapModeClamp, &grad);
+    expect(Ok, status);
+
+    status = GdipGetPathGradientPath(grad, NULL);
+    expect(NotImplemented, status);
+
+    status = GdipCreatePath(FillModeWinding, &path);
+    expect(Ok, status);
+
+    status = GdipGetPathGradientPath(NULL, path);
+    expect(NotImplemented, status);
+
+    status = GdipGetPathGradientPath(grad, path);
+    expect(NotImplemented, status);
+
+    status = GdipDeletePath(path);
+    expect(Ok, status);
+
+    status = GdipDeleteBrush((GpBrush*)grad);
+    expect(Ok, status);
+}
+
 START_TEST(brush)
 {
     struct GdiplusStartupInput gdiplusStartupInput;
@@ -848,6 +876,7 @@ START_TEST(brush)
     test_lineblend();
     test_linelinearblend();
     test_gradientsurroundcolorcount();
+    test_pathgradientpath();
 
     GdiplusShutdown(gdiplusToken);
 }
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 6792004..9a8c5ff 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -554,6 +554,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient*,GpPointF*);
 GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient*,GpPoint*);
 GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient*,REAL*,REAL*);
 GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(GpPathGradient*,BOOL*);
+GpStatus WINGDIPAPI GdipGetPathGradientPath(GpPathGradient*,GpPath*);
 GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient*,INT*);
 GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend(GpPathGradient*,
     GDIPCONST ARGB*,GDIPCONST REAL*,INT);
-- 
1.7.9


More information about the wine-patches mailing list