Author: tkreuzer
Date: Thu Dec 18 08:11:42 2014
New Revision: 65724

URL: http://svn.reactos.org/svn/reactos?rev=65724&view=rev
Log:
[WIN32K]
- Move NtGdiFillRgn and NtGdiFrameRgn to bitblt.c
- Remove unused NtGdiUnionRectWithRgn
- Rename REGION_CreateFrameRgn to GreCreateFrameRgn

Modified:
    trunk/reactos/win32ss/gdi/ntgdi/bitblt.c
    trunk/reactos/win32ss/gdi/ntgdi/region.c
    trunk/reactos/win32ss/gdi/ntgdi/region.h

Modified: trunk/reactos/win32ss/gdi/ntgdi/bitblt.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitblt.c?rev=65724&r1=65723&r2=65724&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/bitblt.c    [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/bitblt.c    [iso-8859-1] Thu Dec 18 
08:11:42 2014
@@ -1012,6 +1012,71 @@
 
 BOOL
 APIENTRY
+NtGdiFillRgn(
+    HDC hDC,
+    HRGN hRgn,
+    HBRUSH hBrush)
+{
+    HBRUSH oldhBrush;
+    PREGION rgn;
+    PRECTL r;
+
+    rgn = RGNOBJAPI_Lock(hRgn, NULL);
+    if (rgn == NULL)
+    {
+        return FALSE;
+    }
+
+    oldhBrush = NtGdiSelectBrush(hDC, hBrush);
+    if (oldhBrush == NULL)
+    {
+        RGNOBJAPI_Unlock(rgn);
+        return FALSE;
+    }
+
+    for (r = rgn->Buffer; r < rgn->Buffer + rgn->rdh.nCount; r++)
+    {
+        NtGdiPatBlt(hDC, r->left, r->top, r->right - r->left, r->bottom - 
r->top, PATCOPY);
+    }
+
+    RGNOBJAPI_Unlock(rgn);
+    NtGdiSelectBrush(hDC, oldhBrush);
+
+    return TRUE;
+}
+
+BOOL
+APIENTRY
+NtGdiFrameRgn(
+    HDC hDC,
+    HRGN hRgn,
+    HBRUSH hBrush,
+    INT Width,
+    INT Height)
+{
+    HRGN FrameRgn;
+    BOOL Ret;
+
+    FrameRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+    if (FrameRgn == NULL)
+    {
+        return FALSE;
+    }
+
+    if (!GreCreateFrameRgn(FrameRgn, hRgn, Width, Height))
+    {
+        GreDeleteObject(FrameRgn);
+        return FALSE;
+    }
+
+    Ret = NtGdiFillRgn(hDC, FrameRgn, hBrush);
+
+    GreDeleteObject(FrameRgn);
+    return Ret;
+}
+
+BOOL
+APIENTRY
 NtGdiInvertRgn(
     HDC hDC,
     HRGN hRgn)

Modified: trunk/reactos/win32ss/gdi/ntgdi/region.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/region.c?rev=65724&r1=65723&r2=65724&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/region.c    [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/region.c    [iso-8859-1] Thu Dec 18 
08:11:42 2014
@@ -1840,7 +1840,7 @@
 
 BOOL
 FASTCALL
-REGION_CreateFrameRgn(
+GreCreateFrameRgn(
     HRGN hDest,
     HRGN hSrc,
     INT x,
@@ -3745,72 +3745,6 @@
     return hRgn;
 }
 
-BOOL
-APIENTRY
-NtGdiFillRgn(
-    HDC hDC,
-    HRGN hRgn,
-    HBRUSH hBrush)
-{
-    HBRUSH oldhBrush;
-    PREGION rgn;
-    PRECTL r;
-
-    rgn = RGNOBJAPI_Lock(hRgn, NULL);
-    if (rgn == NULL)
-    {
-        return FALSE;
-    }
-
-    oldhBrush = NtGdiSelectBrush(hDC, hBrush);
-    if (oldhBrush == NULL)
-    {
-        RGNOBJAPI_Unlock(rgn);
-        return FALSE;
-    }
-
-    for (r = rgn->Buffer; r < rgn->Buffer + rgn->rdh.nCount; r++)
-    {
-        NtGdiPatBlt(hDC, r->left, r->top, r->right - r->left, r->bottom - 
r->top, PATCOPY);
-    }
-
-    RGNOBJAPI_Unlock(rgn);
-    NtGdiSelectBrush(hDC, oldhBrush);
-
-    return TRUE;
-}
-
-BOOL
-APIENTRY
-NtGdiFrameRgn(
-    HDC hDC,
-    HRGN hRgn,
-    HBRUSH hBrush,
-    INT Width,
-    INT Height)
-{
-    HRGN FrameRgn;
-    BOOL Ret;
-
-    FrameRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
-    if (FrameRgn == NULL)
-    {
-        return FALSE;
-    }
-
-    if (!REGION_CreateFrameRgn(FrameRgn, hRgn, Width, Height))
-    {
-        GreDeleteObject(FrameRgn);
-        return FALSE;
-    }
-
-    Ret = NtGdiFillRgn(hDC, FrameRgn, hBrush);
-
-    GreDeleteObject(FrameRgn);
-    return Ret;
-}
-
-
 INT
 APIENTRY
 NtGdiGetRgnBox(
@@ -3949,46 +3883,6 @@
 
     RGNOBJAPI_Unlock(rgn);
     return TRUE;
-}
-
-HRGN
-APIENTRY
-NtGdiUnionRectWithRgn(
-    HRGN hDest,
-    const RECTL *UnsafeRect)
-{
-    RECTL SafeRect = { 0 };
-    PREGION Rgn;
-    NTSTATUS Status = STATUS_SUCCESS;
-
-    Rgn = RGNOBJAPI_Lock(hDest, NULL);
-    if (Rgn == NULL)
-    {
-        EngSetLastError(ERROR_INVALID_HANDLE);
-        return NULL;
-    }
-
-    _SEH2_TRY
-    {
-        ProbeForRead(UnsafeRect, sizeof(RECT), 1);
-        SafeRect = *UnsafeRect;
-    }
-    _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
-    {
-        Status = _SEH2_GetExceptionCode();
-    }
-    _SEH2_END;
-
-    if (!NT_SUCCESS(Status))
-    {
-        RGNOBJAPI_Unlock(Rgn);
-        SetLastNtError(Status);
-        return NULL;
-    }
-
-    REGION_UnionRectWithRgn(Rgn, &SafeRect);
-    RGNOBJAPI_Unlock(Rgn);
-    return hDest;
 }
 
 /*!

Modified: trunk/reactos/win32ss/gdi/ntgdi/region.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/region.h?rev=65724&r1=65723&r2=65724&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/region.h    [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/region.h    [iso-8859-1] Thu Dec 18 
08:11:42 2014
@@ -53,6 +53,14 @@
 PREGION FASTCALL IntSysCreateRectpRgn(INT,INT,INT,INT);
 BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD);
 
+BOOL
+FASTCALL
+GreCreateFrameRgn(
+    HRGN hDest,
+    HRGN hSrc,
+    INT x,
+    INT y);
+
 #define IntSysCreateRectpRgnIndirect(prc) \
   IntSysCreateRectpRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
 


Reply via email to