gdiplus: Implemented GdipIsEmptyRegion with tests.
This commit is contained in:
parent
26cb843130
commit
fb57a66378
|
@ -735,9 +735,14 @@ GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HR
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BOOL *res)
|
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,
|
GpStatus WINGDIPAPI GdipIsEqualRegion(GpRegion *region, GpRegion *region2, GpGraphics *graphics,
|
||||||
|
|
|
@ -506,6 +506,50 @@ static void test_isinfinite(void)
|
||||||
|
|
||||||
GdipDeleteMatrix(m);
|
GdipDeleteMatrix(m);
|
||||||
GdipDeleteRegion(region);
|
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(®ion);
|
||||||
|
|
||||||
|
/* 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);
|
ReleaseDC(0, hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,6 +567,7 @@ START_TEST(region)
|
||||||
|
|
||||||
test_getregiondata();
|
test_getregiondata();
|
||||||
test_isinfinite();
|
test_isinfinite();
|
||||||
|
test_isempty();
|
||||||
|
|
||||||
GdiplusShutdown(gdiplusToken);
|
GdiplusShutdown(gdiplusToken);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue