From 402781376436347d098417c4830145e37f795967 Mon Sep 17 00:00:00 2001 From: Justin Chevrier Date: Sat, 27 Mar 2010 17:55:27 -0400 Subject: [PATCH] gdiplus: Add GdipGetPathGradientSurroundColorCount stub with tests. --- dlls/gdiplus/brush.c | 10 +++++++ dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/tests/brush.c | 56 ++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 4 files changed, 68 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 5582a952b83..8994b8775a9 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1167,6 +1167,16 @@ GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient return NotImplemented; } +GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount(GpPathGradient *brush, INT *count) +{ + TRACE("(%p, %p)\n", brush, count); + + if (!brush || !count) + return InvalidParameter; + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipGetPathGradientWrapMode(GpPathGradient *brush, GpWrapMode *wrapmode) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index e6cea5ad443..14e7fbff4a8 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -338,7 +338,7 @@ @ stub GdipGetPathGradientPresetBlendCount @ stdcall GdipGetPathGradientRect(ptr ptr) @ stdcall GdipGetPathGradientRectI(ptr ptr) -@ stub GdipGetPathGradientSurroundColorCount +@ stdcall GdipGetPathGradientSurroundColorCount(ptr ptr) @ stdcall GdipGetPathGradientSurroundColorsWithCount(ptr ptr ptr) @ stub GdipGetPathGradientTransform @ stdcall GdipGetPathGradientWrapMode(ptr ptr) diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index 0ee4dd485a2..0effcf40fd6 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -646,6 +646,61 @@ static void test_linelinearblend(void) expect(Ok, status); } +static void test_gradientsurroundcolorcount(void) +{ + GpStatus status; + GpPathGradient *grad; + ARGB *color; + INT count = 3; + + status = GdipCreatePathGradient(blendcount_ptf, 2, WrapModeClamp, &grad); + expect(Ok, status); + + color = GdipAlloc(sizeof(ARGB[3])); + + status = GdipSetPathGradientSurroundColorsWithCount(grad, color, &count); + expect(InvalidParameter, status); + GdipFree(color); + + count = 2; + + color = GdipAlloc(sizeof(ARGB[2])); + + color[0] = 0x00ff0000; + color[1] = 0x0000ff00; + + status = GdipSetPathGradientSurroundColorsWithCount(NULL, color, &count); + expect(InvalidParameter, status); + + status = GdipSetPathGradientSurroundColorsWithCount(grad, NULL, &count); + expect(InvalidParameter, status); + + /* WinXP crashes on this test */ + if(0) + { + status = GdipSetPathGradientSurroundColorsWithCount(grad, color, NULL); + expect(InvalidParameter, status); + } + + status = GdipSetPathGradientSurroundColorsWithCount(grad, color, &count); + todo_wine expect(Ok, status); + expect(2, count); + + status = GdipGetPathGradientSurroundColorCount(NULL, &count); + expect(InvalidParameter, status); + + status = GdipGetPathGradientSurroundColorCount(grad, NULL); + expect(InvalidParameter, status); + + count = 0; + status = GdipGetPathGradientSurroundColorCount(grad, &count); + todo_wine expect(Ok, status); + todo_wine expect(2, count); + + GdipFree(color); + GdipDeleteBrush((GpBrush*)grad); +} + START_TEST(brush) { struct GdiplusStartupInput gdiplusStartupInput; @@ -669,6 +724,7 @@ START_TEST(brush) test_gradientgetrect(); test_lineblend(); test_linelinearblend(); + test_gradientsurroundcolorcount(); GdiplusShutdown(gdiplusToken); } diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 96723674e48..8312e16490a 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -563,6 +563,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend(GpPathGradient*,REAL,REAL); GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient*, GDIPCONST ARGB*,INT*); GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(GpPathGradient*,GpWrapMode); +GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount(GpPathGradient*,INT*); /* PathIterator */ GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator**,GpPath*);