Commit fb57a663 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Implemented GdipIsEmptyRegion with tests.

parent 26cb8431
......@@ -735,9 +735,14 @@ GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HR
GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BOOL *res)
{
FIXME("(%p, %p, %p): stub\n", region, graphics, res);
TRACE("(%p, %p, %p)\n", region, graphics, res);
return NotImplemented;
if(!region || !graphics || !res)
return InvalidParameter;
*res = (region->node.type == RegionDataEmptyRect);
return Ok;
}
GpStatus WINGDIPAPI GdipIsEqualRegion(GpRegion *region, GpRegion *region2, GpGraphics *graphics,
......
......@@ -506,6 +506,50 @@ static void test_isinfinite(void)
GdipDeleteMatrix(m);
GdipDeleteRegion(region);
GdipDeleteGraphics(graphics);
ReleaseDC(0, hdc);
}
static void test_isempty(void)
{
GpStatus status;
GpRegion *region;
GpGraphics *graphics = NULL;
HDC hdc = GetDC(0);
BOOL res;
status = GdipCreateFromHDC(hdc, &graphics);
expect(Ok, status);
GdipCreateRegion(&region);
/* NULL arguments */
status = GdipIsEmptyRegion(NULL, NULL, NULL);
expect(InvalidParameter, status);
status = GdipIsEmptyRegion(region, NULL, NULL);
expect(InvalidParameter, status);
status = GdipIsEmptyRegion(NULL, graphics, NULL);
expect(InvalidParameter, status);
status = GdipIsEmptyRegion(NULL, NULL, &res);
expect(InvalidParameter, status);
status = GdipIsEmptyRegion(region, NULL, &res);
expect(InvalidParameter, status);
/* default is infinite */
res = TRUE;
status = GdipIsEmptyRegion(region, graphics, &res);
expect(Ok, status);
expect(FALSE, res);
status = GdipSetEmpty(region);
expect(Ok, status);
res = FALSE;
status = GdipIsEmptyRegion(region, graphics, &res);
expect(Ok, status);
expect(TRUE, res);
GdipDeleteRegion(region);
GdipDeleteGraphics(graphics);
ReleaseDC(0, hdc);
}
......@@ -523,6 +567,7 @@ START_TEST(region)
test_getregiondata();
test_isinfinite();
test_isempty();
GdiplusShutdown(gdiplusToken);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment