Commit cf3d4928 authored by Adam Petaccia's avatar Adam Petaccia Committed by Alexandre Julliard

gdiplus: Implement GdipCreateRegionRectI.

parent d215b474
...@@ -358,12 +358,19 @@ GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, ...@@ -358,12 +358,19 @@ GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect,
return Ok; return Ok;
} }
GpStatus WINGDIPAPI GdipCreateRegionRectI(GDIPCONST GpRect *rect, GpRegion **region) GpStatus WINGDIPAPI GdipCreateRegionRectI(GDIPCONST GpRect *rect,
GpRegion **region)
{ {
FIXME("(%p, %p): stub\n", rect, region); GpRectF rectf;
*region = NULL; TRACE("%p, %p\n", rect, region);
return NotImplemented;
rectf.X = (REAL)rect->X;
rectf.Y = (REAL)rect->Y;
rectf.Width = (REAL)rect->Width;
rectf.Height = (REAL)rect->Height;
return GdipCreateRegionRect(&rectf, region);
} }
GpStatus WINGDIPAPI GdipCreateRegionRgnData(GDIPCONST BYTE *data, INT size, GpRegion **region) GpStatus WINGDIPAPI GdipCreateRegionRgnData(GDIPCONST BYTE *data, INT size, GpRegion **region)
......
...@@ -115,8 +115,6 @@ todo_wine ...@@ -115,8 +115,6 @@ todo_wine
rect.Y = 20; rect.Y = 20;
rect.Width = 100; rect.Width = 100;
rect.Height = 200; rect.Height = 200;
todo_wine
{
status = GdipCreateRegionRectI(&rect, &region); status = GdipCreateRegionRectI(&rect, &region);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
status = GdipGetRegionDataSize(region, &needed); status = GdipGetRegionDataSize(region, &needed);
...@@ -127,11 +125,8 @@ todo_wine ...@@ -127,11 +125,8 @@ todo_wine
expect(36, needed); expect(36, needed);
expect_dword(buf, 28); expect_dword(buf, 28);
trace("buf[1] = %08x\n", buf[1]); trace("buf[1] = %08x\n", buf[1]);
}
expect_magic((DWORD*)(buf + 2)); expect_magic((DWORD*)(buf + 2));
expect_dword(buf + 3, 0); expect_dword(buf + 3, 0);
todo_wine
{
expect_dword(buf + 4, RGNDATA_RECT); expect_dword(buf + 4, RGNDATA_RECT);
expect_float(buf + 5, 10.0); expect_float(buf + 5, 10.0);
expect_float(buf + 6, 20.0); expect_float(buf + 6, 20.0);
...@@ -142,6 +137,8 @@ todo_wine ...@@ -142,6 +137,8 @@ todo_wine
rect.Y = 30; rect.Y = 30;
rect.Width = 10; rect.Width = 10;
rect.Height = 20; rect.Height = 20;
todo_wine
{
status = GdipCombineRegionRectI(region, &rect, CombineModeIntersect); status = GdipCombineRegionRectI(region, &rect, CombineModeIntersect);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
rect.X = 100; rect.X = 100;
...@@ -150,6 +147,7 @@ todo_wine ...@@ -150,6 +147,7 @@ todo_wine
rect.Height = 50; rect.Height = 50;
status = GdipCombineRegionRectI(region, &rect, CombineModeXor); status = GdipCombineRegionRectI(region, &rect, CombineModeXor);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
}
rect.X = 200; rect.X = 200;
rect.Y = 100; rect.Y = 100;
...@@ -161,6 +159,8 @@ todo_wine ...@@ -161,6 +159,8 @@ todo_wine
rect.Y = 10; rect.Y = 10;
rect.Width = 40; rect.Width = 40;
rect.Height = 66; rect.Height = 66;
todo_wine
{
status = GdipCombineRegionRectI(region2, &rect, CombineModeUnion); status = GdipCombineRegionRectI(region2, &rect, CombineModeUnion);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
...@@ -172,18 +172,21 @@ todo_wine ...@@ -172,18 +172,21 @@ todo_wine
rect.Width = 22; rect.Width = 22;
rect.Height = 55; rect.Height = 55;
status = GdipCombineRegionRectI(region, &rect, CombineModeExclude); status = GdipCombineRegionRectI(region, &rect, CombineModeExclude);
todo_wine
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
}
status = GdipGetRegionDataSize(region, &needed); status = GdipGetRegionDataSize(region, &needed);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
todo_wine
expect(156, needed); expect(156, needed);
status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
todo_wine
{
expect(156, needed); expect(156, needed);
expect_dword(buf, 148); expect_dword(buf, 148);
trace("buf[1] = %08x\n", buf[1]);
} }
trace("buf[1] = %08x\n", buf[1]);
expect_magic((DWORD*)(buf + 2)); expect_magic((DWORD*)(buf + 2));
todo_wine todo_wine
{ {
...@@ -223,12 +226,12 @@ todo_wine ...@@ -223,12 +226,12 @@ todo_wine
expect_float(buf + 36, 500.0); expect_float(buf + 36, 500.0);
expect_float(buf + 37, 22.0); expect_float(buf + 37, 22.0);
expect_float(buf + 38, 55.0); expect_float(buf + 38, 55.0);
}
status = GdipDeleteRegion(region2); status = GdipDeleteRegion(region2);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
status = GdipDeleteRegion(region); status = GdipDeleteRegion(region);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
}
/* Try some paths */ /* Try some paths */
......
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