gdiplus: Add GdipGetPathGradientSurroundColorCount stub with tests.

oldstable
Justin Chevrier 2010-03-27 17:55:27 -04:00 committed by Alexandre Julliard
parent 88b4263a61
commit 4027813764
4 changed files with 68 additions and 1 deletions

View File

@ -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)
{

View File

@ -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)

View File

@ -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);
}

View File

@ -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*);