gdi: GetRandomRgn #2

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

gdi: GetRandomRgn #2

Huw Davies-3
        Huw Davies <[hidden email]>
        If the meta/clip intersection (Rao) region doesn't exist, return
        either the meta or clip region if they do exist.
        Remove the wine_todo's.

Index: dlls/gdi/clipping.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/clipping.c,v
retrieving revision 1.6
diff -u -p -r1.6 clipping.c
--- dlls/gdi/clipping.c 10 Oct 2005 19:53:22 -0000 1.6
+++ dlls/gdi/clipping.c 11 Oct 2005 08:10:27 -0000
@@ -566,6 +566,8 @@ INT WINAPI GetRandomRgn(HDC hDC, HRGN hR
         break;
     case 3:
         rgn = dc->hMetaClipRgn;
+        if(!rgn) rgn = dc->hClipRgn;
+        if(!rgn) rgn = dc->hMetaRgn;
         break;
     case SYSRGN: /* == 4 */
         rgn = dc->hVisRgn;
Index: dlls/gdi/tests/clipping.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/tests/clipping.c,v
retrieving revision 1.1
diff -u -p -r1.1 clipping.c
--- dlls/gdi/tests/clipping.c 10 Oct 2005 19:53:22 -0000 1.1
+++ dlls/gdi/tests/clipping.c 11 Oct 2005 08:10:28 -0000
@@ -58,11 +58,8 @@ static void test_GetRandomRgn(void)
     ret = GetRandomRgn(hdc, hrgn, 2);
     ok(ret == 0, "GetRandomRgn rets %d\n", ret);
 
-    todo_wine
-    {
-        ret = GetRandomRgn(hdc, hrgn, 3);
-        ok(ret != 0, "GetRandomRgn rets %d\n", ret);
-    }
+    ret = GetRandomRgn(hdc, hrgn, 3);
+    ok(ret != 0, "GetRandomRgn rets %d\n", ret);
     GetRgnBox(hrgn, &ret_rc);
     ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %ld,%ld - %ld,%ld\n",
        ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
@@ -78,11 +75,8 @@ static void test_GetRandomRgn(void)
     ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %ld,%ld - %ld,%ld\n",
        ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
 
-    todo_wine
-    {
-        ret = GetRandomRgn(hdc, hrgn, 3);
-        ok(ret != 0, "GetRandomRgn rets %d\n", ret);
-    }
+    ret = GetRandomRgn(hdc, hrgn, 3);
+    ok(ret != 0, "GetRandomRgn rets %d\n", ret);
     GetRgnBox(hrgn, &ret_rc);
     ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %ld,%ld - %ld,%ld\n",
        ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);