gdiplus: Implement GdipCombineRegionRegion.

This commit is contained in:
Adam Petaccia 2008-08-04 13:56:56 -04:00 committed by Alexandre Julliard
parent 5bc8ddd86c
commit 2a445d0ebd
2 changed files with 27 additions and 13 deletions

View File

@ -311,11 +311,34 @@ GpStatus WINGDIPAPI GdipCombineRegionRectI(GpRegion *region,
return GdipCombineRegionRect(region, &rectf, mode);
}
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1, GpRegion *region2,
CombineMode mode)
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1,
GpRegion *region2, CombineMode mode)
{
FIXME("(%p %p %d): stub\n", region1, region2, mode);
return NotImplemented;
region_element *left, *right;
GpStatus stat;
TRACE("%p %p %d\n", region1, region2, mode);
if(!(region1 && region2))
return InvalidParameter;
left = GdipAlloc(sizeof(region_element));
if (!left)
return OutOfMemory;
*left = region1->node;
stat = clone_element(&region2->node, &right);
if (stat != Ok)
{
GdipFree(left);
delete_element(right);
return OutOfMemory;
}
fuse_region(region1, left, right, mode);
region1->header.num_children += region2->header.num_children;
return Ok;
}
GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region)

View File

@ -160,7 +160,6 @@ todo_wine
ok(status == Ok, "status %08x\n", status);
status = GdipCombineRegionRegion(region, region2, CombineModeComplement);
todo_wine
ok(status == Ok, "status %08x\n", status);
rect.X = 400;
@ -172,22 +171,15 @@ todo_wine
status = GdipGetRegionDataSize(region, &needed);
ok(status == Ok, "status %08x\n", status);
todo_wine
expect(156, needed);
status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed);
ok(status == Ok, "status %08x\n", status);
todo_wine
{
expect(156, needed);
expect_dword(buf, 148);
}
trace("buf[1] = %08x\n", buf[1]);
expect_magic((DWORD*)(buf + 2));
todo_wine
expect_dword(buf + 3, 10);
expect_dword(buf + 4, CombineModeExclude);
todo_wine
{
expect_dword(buf + 5, CombineModeComplement);
expect_dword(buf + 6, CombineModeXor);
expect_dword(buf + 7, CombineModeIntersect);
@ -222,7 +214,6 @@ todo_wine
expect_float(buf + 36, 500.0);
expect_float(buf + 37, 22.0);
expect_float(buf + 38, 55.0);
}
status = GdipDeleteRegion(region2);
ok(status == Ok, "status %08x\n", status);