Jacek Caban : gdi32: Introduce NtGdiExtCreateRegion.
Alexandre Julliard
julliard at winehq.org
Wed Jul 7 15:01:30 CDT 2021
Module: wine
Branch: master
Commit: 94876d81ce4b7e8ae1080a02b943a5557bce72c7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=94876d81ce4b7e8ae1080a02b943a5557bce72c7
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Jul 7 15:02:26 2021 +0200
gdi32: Introduce NtGdiExtCreateRegion.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/objects.c | 16 ++++++++++++++++
dlls/gdi32/region.c | 18 ++++++------------
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c
index 16c03f56508..54a5fcef585 100644
--- a/dlls/gdi32/objects.c
+++ b/dlls/gdi32/objects.c
@@ -235,3 +235,19 @@ HBITMAP WINAPI CreateDiscardableBitmap( HDC hdc, INT width, INT height )
{
return CreateCompatibleBitmap( hdc, width, height );
}
+
+/***********************************************************************
+ * ExtCreateRegion (GDI32.@)
+ *
+ * Creates a region as specified by the transformation data and region data.
+ */
+HRGN WINAPI ExtCreateRegion( const XFORM *xform, DWORD count, const RGNDATA *data )
+{
+ if (!data)
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return 0;
+ }
+
+ return NtGdiExtCreateRegion( xform, count, data );
+}
diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c
index 2e90e82180e..dadb9b80ac9 100644
--- a/dlls/gdi32/region.c
+++ b/dlls/gdi32/region.c
@@ -920,7 +920,7 @@ static void translate( POINT *pt, UINT count, const XFORM *xform )
/***********************************************************************
- * ExtCreateRegion (GDI32.@)
+ * NtGdiExtCreateRegion (win32u.@)
*
* Creates a region as specified by the transformation data and region data.
*
@@ -936,26 +936,20 @@ static void translate( POINT *pt, UINT count, const XFORM *xform )
* NOTES
* See GetRegionData().
*/
-HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA* rgndata)
+HRGN WINAPI NtGdiExtCreateRegion( const XFORM *xform, DWORD count, const RGNDATA *rgndata )
{
HRGN hrgn = 0;
WINEREGION *obj;
const RECT *pCurRect, *pEndRect;
- if (!rgndata)
- {
- SetLastError( ERROR_INVALID_PARAMETER );
- return 0;
- }
-
- if (rgndata->rdh.dwSize < sizeof(RGNDATAHEADER))
+ if (!rgndata || rgndata->rdh.dwSize < sizeof(RGNDATAHEADER))
return 0;
/* XP doesn't care about the type */
if( rgndata->rdh.iType != RDH_RECTANGLES )
WARN("(Unsupported region data type: %u)\n", rgndata->rdh.iType);
- if (lpXform)
+ if (xform)
{
const RECT *pCurRect, *pEndRect;
@@ -977,7 +971,7 @@ HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA*
pt[3].x = pCurRect->left;
pt[3].y = pCurRect->bottom;
- translate( pt, 4, lpXform );
+ translate( pt, 4, xform );
poly_hrgn = CreatePolyPolygonRgn( pt, &count, 1, WINDING );
CombineRgn( hrgn, hrgn, poly_hrgn, RGN_OR );
DeleteObject( poly_hrgn );
@@ -1000,7 +994,7 @@ HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA*
done:
if (!hrgn) free_region( obj );
- TRACE("%p %d %p returning %p\n", lpXform, dwCount, rgndata, hrgn );
+ TRACE("%p %d %p returning %p\n", xform, count, rgndata, hrgn );
return hrgn;
}
More information about the wine-cvs
mailing list