Module: wine Branch: master Commit: cf3d4928bd51028ecd633a45f0250c76420d78e9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=cf3d4928bd51028ecd633a45f0...
Author: Adam Petaccia adam@tpetaccia.com Date: Mon Aug 4 13:56:41 2008 -0400
gdiplus: Implement GdipCreateRegionRectI.
---
dlls/gdiplus/region.c | 15 +++++++++++---- dlls/gdiplus/tests/region.c | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 64ac9a5..fb658fd 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -358,12 +358,19 @@ GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, 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; - return NotImplemented; + TRACE("%p, %p\n", rect, region); + + 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) diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 17a4ba4..738c86d 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -115,8 +115,6 @@ todo_wine rect.Y = 20; rect.Width = 100; rect.Height = 200; -todo_wine -{ status = GdipCreateRegionRectI(&rect, ®ion); ok(status == Ok, "status %08x\n", status); status = GdipGetRegionDataSize(region, &needed); @@ -127,11 +125,8 @@ todo_wine expect(36, needed); expect_dword(buf, 28); trace("buf[1] = %08x\n", buf[1]); -} expect_magic((DWORD*)(buf + 2)); expect_dword(buf + 3, 0); -todo_wine -{ expect_dword(buf + 4, RGNDATA_RECT); expect_float(buf + 5, 10.0); expect_float(buf + 6, 20.0); @@ -142,6 +137,8 @@ todo_wine rect.Y = 30; rect.Width = 10; rect.Height = 20; +todo_wine +{ status = GdipCombineRegionRectI(region, &rect, CombineModeIntersect); ok(status == Ok, "status %08x\n", status); rect.X = 100; @@ -150,6 +147,7 @@ todo_wine rect.Height = 50; status = GdipCombineRegionRectI(region, &rect, CombineModeXor); ok(status == Ok, "status %08x\n", status); +}
rect.X = 200; rect.Y = 100; @@ -161,6 +159,8 @@ todo_wine rect.Y = 10; rect.Width = 40; rect.Height = 66; +todo_wine +{ status = GdipCombineRegionRectI(region2, &rect, CombineModeUnion); ok(status == Ok, "status %08x\n", status);
@@ -172,18 +172,21 @@ todo_wine rect.Width = 22; rect.Height = 55; status = GdipCombineRegionRectI(region, &rect, CombineModeExclude); -todo_wine ok(status == Ok, "status %08x\n", status);
+} 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]); } + trace("buf[1] = %08x\n", buf[1]); expect_magic((DWORD*)(buf + 2)); todo_wine { @@ -223,12 +226,12 @@ 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); status = GdipDeleteRegion(region); ok(status == Ok, "status %08x\n", status); -}
/* Try some paths */