ReactOS  0.4.14-dev-614-gbfd8a84
region.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _REGION
 

Macros

#define IntSysCreateRectpRgnIndirect(prc)   IntSysCreateRectpRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
 
#define GreCreateRectRgnIndirect(prc)   NtGdiCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
 
#define GreSetRectRgnIndirect(hRgn, prc)   NtGdiSetRectRgn(hRgn, (prc)->left, (prc)->top, (prc)->right, (prc)->bottom);
 

Typedefs

typedef struct _REGION REGION
 
typedef struct _REGIONPREGION
 

Functions

PREGION FASTCALL REGION_AllocRgnWithHandle (INT n)
 
PREGION FASTCALL REGION_AllocUserRgnWithHandle (INT n)
 
BOOL FASTCALL REGION_UnionRectWithRgn (PREGION rgn, const RECTL *rect)
 
INT FASTCALL REGION_SubtractRectFromRgn (PREGION prgnDest, PREGION prgnSrc, const RECTL *prcl)
 
INT FASTCALL REGION_GetRgnBox (PREGION Rgn, RECTL *pRect)
 
BOOL FASTCALL REGION_RectInRegion (PREGION Rgn, const RECTL *rc)
 
BOOL FASTCALL REGION_PtInRegion (PREGION, INT, INT)
 
INT FASTCALL REGION_CropRegion (PREGION rgnDst, PREGION rgnSrc, const RECTL *rect)
 
VOID FASTCALL REGION_SetRectRgn (PREGION pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
 
VOID NTAPI REGION_vCleanup (PVOID ObjectBody)
 
VOID FASTCALL REGION_Delete (PREGION)
 
INT APIENTRY IntGdiGetRgnBox (HRGN, RECTL *)
 
PREGION FASTCALL REGION_LockRgn (_In_ HRGN hrgn)
 
VOID FASTCALL REGION_UnlockRgn (_In_ PREGION prgn)
 
BOOL FASTCALL REGION_bXformRgn (_Inout_ PREGION prgn, _In_ PMATRIX pmx)
 
BOOL FASTCALL REGION_SetPolyPolygonRgn (_Inout_ PREGION prgn, _In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
 
HRGN NTAPI GreCreatePolyPolygonRgn (_In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
 
BOOL FASTCALL REGION_bOffsetRgn (_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
 
BOOL FASTCALL IntRectInRegion (HRGN, LPRECTL)
 
INT FASTCALL IntGdiCombineRgn (PREGION, PREGION, PREGION, INT)
 
INT FASTCALL REGION_Complexity (PREGION)
 
PREGION FASTCALL IntSysCreateRectpRgn (INT, INT, INT, INT)
 
BOOL FASTCALL IntGdiSetRegionOwner (HRGN, DWORD)
 
HRGN FASTCALL GreCreateFrameRgn (HRGN hrgn, INT x, INT y)
 

Variables

PREGION prgnDefault
 
HRGN hrgnDefault
 

Macro Definition Documentation

◆ GreCreateRectRgnIndirect

#define GreCreateRectRgnIndirect (   prc)    NtGdiCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)

Definition at line 96 of file region.h.

◆ GreSetRectRgnIndirect

#define GreSetRectRgnIndirect (   hRgn,
  prc 
)    NtGdiSetRectRgn(hRgn, (prc)->left, (prc)->top, (prc)->right, (prc)->bottom);

Definition at line 99 of file region.h.

◆ IntSysCreateRectpRgnIndirect

#define IntSysCreateRectpRgnIndirect (   prc)    IntSysCreateRectpRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)

Definition at line 93 of file region.h.

Typedef Documentation

◆ PREGION

typedef struct _REGION * PREGION

◆ REGION

Function Documentation

◆ GreCreateFrameRgn()

HRGN FASTCALL GreCreateFrameRgn ( HRGN  hrgn,
INT  x,
INT  y 
)

Definition at line 2041 of file region.c.

2045 {
2046  PREGION prgnFrame, prgnSrc;
2047  HRGN hrgnFrame;
2048 
2049  /* Allocate a new region */
2050  prgnFrame = REGION_AllocUserRgnWithHandle(1);
2051  if (prgnFrame == NULL)
2052  {
2054  return NULL;
2055  }
2056 
2057  /* Lock the source region */
2058  prgnSrc = REGION_LockRgn(hrgn);
2059  if (prgnSrc == NULL)
2060  {
2061  REGION_Delete(prgnFrame);
2062  return FALSE;
2063  }
2064 
2065  if (REGION_bMakeFrameRegion(prgnFrame, prgnSrc, cx, cy))
2066  {
2067  hrgnFrame = prgnFrame->BaseObject.hHmgr;
2068  REGION_UnlockRgn(prgnFrame);
2069  }
2070  else
2071  {
2072  REGION_Delete(prgnFrame);
2073  hrgnFrame = NULL;
2074  }
2075 
2076  REGION_UnlockRgn(prgnSrc);
2077  return hrgnFrame;
2078 }
BASEOBJECT BaseObject
Definition: region.h:11
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2377
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
static BOOL REGION_bMakeFrameRegion(_Inout_ PREGION prgnDest, _Inout_ PREGION prgnSrc, _In_ INT cx, _In_ INT cy)
Definition: region.c:1956
static HRGN hrgn
Definition: win.c:55
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2392
_Out_opt_ int * cx
Definition: commctrl.h:581
PREGION FASTCALL REGION_AllocUserRgnWithHandle(INT nRgn)
Definition: region.c:2313
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2468
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by NtGdiFrameRgn().

◆ GreCreatePolyPolygonRgn()

HRGN NTAPI GreCreatePolyPolygonRgn ( _In_ const POINT ppt,
_In_ const ULONG pcPoints,
_In_ ULONG  cPolygons,
_In_ INT  iMode 
)

Definition at line 3471 of file region.c.

3476 {
3477  PREGION prgn;
3478  HRGN hrgn;
3479 
3480  /* Allocate a new region */
3482  if (prgn == NULL)
3483  {
3485  return NULL;
3486  }
3487 
3488  /* Call the internal function and check for success */
3489  if (REGION_SetPolyPolygonRgn(prgn, ppt, pcPoints, cPolygons, iMode))
3490  {
3491  /* Success, get the handle and unlock the region */
3492  hrgn = prgn->BaseObject.hHmgr;
3493  REGION_UnlockRgn(prgn);
3494  }
3495  else
3496  {
3497  /* Failure, delete the region */
3498  REGION_Delete(prgn);
3499  hrgn = NULL;
3500  }
3501 
3502  return hrgn;
3503 }
BASEOBJECT BaseObject
Definition: region.h:11
BOOL FASTCALL REGION_SetPolyPolygonRgn(_Inout_ PREGION prgn, _In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
Definition: region.c:3275
_In_ ULONG iMode
Definition: winddi.h:3520
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
static HRGN hrgn
Definition: win.c:55
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2392
PREGION FASTCALL REGION_AllocUserRgnWithHandle(INT nRgn)
Definition: region.c:2313
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2468
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by NtGdiPolyPolyDraw().

◆ IntGdiCombineRgn()

INT FASTCALL IntGdiCombineRgn ( PREGION  ,
PREGION  ,
PREGION  ,
INT   
)

Definition at line 2506 of file region.c.

2511 {
2512  BOOL Ret = TRUE;
2513 
2514  if (prgnDest == NULL)
2515  {
2516  DPRINT("IntGdiCombineRgn: hDest unavailable\n");
2517  return ERROR;
2518  }
2519 
2520  if (prgnSrc1 == NULL)
2521  {
2522  DPRINT("IntGdiCombineRgn: hSrc1 unavailable\n");
2523  return ERROR;
2524  }
2525 
2526  if (iCombineMode == RGN_COPY)
2527  {
2528  if (!REGION_CopyRegion(prgnDest, prgnSrc1))
2529  return ERROR;
2530 
2531  return REGION_Complexity(prgnDest);
2532  }
2533 
2534  if (prgnSrc2 == NULL)
2535  {
2536  DPRINT1("IntGdiCombineRgn requires hSrc2 != NULL for combine mode %d!\n", iCombineMode);
2537  ASSERT(FALSE);
2538  return ERROR;
2539  }
2540 
2541  switch (iCombineMode)
2542  {
2543  case RGN_AND:
2544  Ret = REGION_IntersectRegion(prgnDest, prgnSrc1, prgnSrc2);
2545  break;
2546  case RGN_OR:
2547  Ret = REGION_UnionRegion(prgnDest, prgnSrc1, prgnSrc2);
2548  break;
2549  case RGN_XOR:
2550  Ret = REGION_XorRegion(prgnDest, prgnSrc1, prgnSrc2);
2551  break;
2552  case RGN_DIFF:
2553  Ret = REGION_SubtractRegion(prgnDest, prgnSrc1, prgnSrc2);
2554  break;
2555  }
2556 
2557  return Ret ? REGION_Complexity(prgnDest) : ERROR;
2558 }
static BOOL FASTCALL REGION_CopyRegion(PREGION dst, PREGION src)
Definition: region.c:587
#define TRUE
Definition: types.h:120
#define ERROR(name)
Definition: error_private.h:53
static BOOL FASTCALL REGION_XorRegion(PREGION dr, PREGION sra, PREGION srb)
Definition: region.c:1768
#define RGN_AND
Definition: wingdi.h:355
unsigned int BOOL
Definition: ntddk_ex.h:94
#define RGN_XOR
Definition: wingdi.h:359
smooth NULL
Definition: ftsmooth.c:416
#define RGN_OR
Definition: wingdi.h:358
void DPRINT(...)
Definition: polytest.cpp:61
static BOOL FASTCALL REGION_UnionRegion(PREGION newReg, PREGION reg1, PREGION reg2)
Definition: region.c:1478
static BOOL FASTCALL REGION_SubtractRegion(PREGION regD, PREGION regM, PREGION regS)
Definition: region.c:1732
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define RGN_COPY
Definition: wingdi.h:356
#define RGN_DIFF
Definition: wingdi.h:357
#define DPRINT1
Definition: precomp.h:8
INT FASTCALL REGION_Complexity(PREGION prgn)
Definition: region.c:567
static BOOL FASTCALL REGION_IntersectRegion(PREGION newReg, PREGION reg1, PREGION reg2)
Definition: region.c:1306

Referenced by _Success_(), co_IntGetUpdateRgn(), co_UserRedrawWindow(), co_VIS_WindowLayoutChanged(), co_WinPosSetWindowPos(), DC_vCopyState(), DceUpdateVisRgn(), ForceNCPaintErase(), IntGdiBitBltRgn(), IntGdiFillRgn(), IntInvalidateWindows(), IntScrollWindowEx(), IntValidateParents(), NtGdiCombineRgn(), NtGdiGetRandomRgn(), REGION_LPTODP(), UserScrollDC(), and VIS_ComputeVisibleRegion().

◆ IntGdiGetRgnBox()

INT APIENTRY IntGdiGetRgnBox ( HRGN  ,
RECTL  
)

◆ IntGdiSetRegionOwner()

BOOL FASTCALL IntGdiSetRegionOwner ( HRGN  ,
DWORD   
)

Definition at line 2478 of file region.c.

2479 {
2480  PREGION prgn;
2481  PRGN_ATTR prgnattr;
2482  PPROCESSINFO ppi;
2483 
2484  prgn = REGION_LockRgn(hRgn);
2485  if (prgn == NULL)
2486  {
2487  return FALSE;
2488  }
2489 
2490  prgnattr = prgn->prgnattr;
2491  if (prgnattr != &prgn->rgnattr)
2492  {
2494  prgn->prgnattr = &prgn->rgnattr;
2496  GdiPoolFree(ppi->pPoolRgnAttr, prgnattr);
2497  }
2498 
2499  REGION_UnlockRgn(prgn);
2500 
2501  return GreSetObjectOwner(hRgn, OwnerMask);
2502 }
BASEOBJECT BaseObject
Definition: region.h:11
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
Definition: gdiobj.c:1252
VOID NTAPI GdiPoolFree(PGDI_POOL pPool, PVOID pvAlloc)
Definition: gdipool.c:233
static HRGN hRgn
Definition: mapping.c:33
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2377
_Notnull_ PRGN_ATTR prgnattr
Definition: region.h:12
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
RGN_ATTR rgnattr
Definition: region.h:13
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
Definition: gdiobj.c:1093
struct _GDI_POOL * pPoolRgnAttr
Definition: win32.h:284
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2392

Referenced by co_UserFreeWindow(), ForceNCPaintErase(), IntBeginPaint(), IntGetNCUpdateRgn(), IntInvalidateWindows(), SelectWindowRgn(), and UserUpdateMonitorSize().

◆ IntRectInRegion()

BOOL FASTCALL IntRectInRegion ( HRGN  ,
LPRECTL   
)

Definition at line 3507 of file region.c.

3510 {
3511  PREGION Rgn;
3512  BOOL Ret;
3513 
3514  Rgn = REGION_LockRgn(hRgn);
3515  if (Rgn == NULL)
3516  {
3517  return ERROR;
3518  }
3519 
3520  Ret = REGION_RectInRegion(Rgn, rc);
3521  REGION_UnlockRgn(Rgn);
3522  return Ret;
3523 }
#define ERROR(name)
Definition: error_private.h:53
static HRGN hRgn
Definition: mapping.c:33
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2377
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
BOOL FASTCALL REGION_RectInRegion(PREGION Rgn, const RECTL *rect)
Definition: region.c:2625
Definition: region.h:7
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2392

Referenced by NtGdiRectInRegion().

◆ IntSysCreateRectpRgn()

PREGION FASTCALL IntSysCreateRectpRgn ( INT  ,
INT  ,
INT  ,
INT   
)

Definition at line 2426 of file region.c.

2431 {
2432  PREGION prgn;
2433 
2434  /* Allocate a region, without a handle */
2436  if (prgn == NULL)
2437  {
2438  return NULL;
2439  }
2440 
2441  /* Initialize it */
2442  prgn->Buffer = &prgn->rdh.rcBound;
2443  prgn->prgnattr = &prgn->rgnattr;
2445  REGION_SetRectRgn(prgn, LeftRect, TopRect, RightRect, BottomRect);
2446 
2447  return prgn;
2448 }
#define ATTR_RGN_VALID
Definition: ntgdihdl.h:210
_Notnull_ PRGN_ATTR prgnattr
Definition: region.h:12
RECTL * Buffer
Definition: region.h:16
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
ULONG AttrFlags
Definition: ntgdihdl.h:269
RGN_ATTR rgnattr
Definition: region.h:13
RGNDATAHEADER rdh
Definition: region.h:15
struct _REGION * PREGION
VOID FASTCALL REGION_SetRectRgn(PREGION rgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2685
POBJ NTAPI GDIOBJ_AllocateObject(UCHAR objt, ULONG cjSize, FLONG fl)
Definition: gdiobj.c:559

Referenced by _Success_(), CLIPPING_UpdateGCRegion(), co_UserRedrawWindow(), co_VIS_WindowLayoutChanged(), co_WinPosSetWindowPos(), DC_InitHack(), DC_vCopyState(), DC_vInitDc(), DC_vUpdateDC(), DceGetVisRgn(), DceUpdateVisRgn(), IntGdiBitBltRgn(), IntGdiFillRgn(), IntGdiSetMetaRgn(), IntInvalidateWindows(), IntScrollWindowEx(), IntSetDefaultRegion(), NtGdiExcludeClipRect(), NtGdiSelectClipPath(), and PATH_FillPathEx().

◆ REGION_AllocRgnWithHandle()

PREGION FASTCALL REGION_AllocRgnWithHandle ( INT  n)

Definition at line 2219 of file region.c.

2221 {
2222  //HRGN hReg;
2223  PREGION pReg;
2224 
2226  sizeof(REGION),
2228  if (pReg == NULL)
2229  {
2230  DPRINT1("Could not allocate a palette.\n");
2231  return NULL;
2232  }
2233 
2234  //hReg = pReg->BaseObject.hHmgr;
2235 
2236  if ((nReg == 0) || (nReg == 1))
2237  {
2238  /* Testing shows that > 95% of all regions have only 1 rect.
2239  Including that here saves us from having to do another allocation */
2240  pReg->Buffer = &pReg->rdh.rcBound;
2241  }
2242  else
2243  {
2245  nReg * sizeof(RECT),
2246  TAG_REGION);
2247  if (pReg->Buffer == NULL)
2248  {
2249  DPRINT1("Could not allocate region buffer\n");
2251  return NULL;
2252  }
2253  }
2254 
2255  EMPTY_REGION(pReg);
2256  pReg->rdh.dwSize = sizeof(RGNDATAHEADER);
2257  pReg->rdh.nCount = nReg;
2258  pReg->rdh.nRgnSize = nReg * sizeof(RECT);
2259  pReg->prgnattr = &pReg->rgnattr;
2260 
2261  /* Initialize the region attribute */
2262  pReg->rgnattr.AttrFlags = 0;
2264  pReg->rgnattr.Rect = pReg->rdh.rcBound;
2265 
2266  /* Finally insert the region into the handle table */
2268  {
2269  DPRINT1("Could not insert palette into handle table.\n");
2271  return NULL;
2272  }
2273 
2274  return pReg;
2275 }
BASEOBJECT BaseObject
Definition: region.h:11
struct _RGNDATAHEADER RGNDATAHEADER
#define TAG_REGION
Definition: tags.h:22
struct tagRECT RECT
_Notnull_ PRGN_ATTR prgnattr
Definition: region.h:12
RECTL * Buffer
Definition: region.h:16
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
ULONG AttrFlags
Definition: ntgdihdl.h:269
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1108
RGN_ATTR rgnattr
Definition: region.h:13
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
ULONG iComplexity
Definition: ntgdihdl.h:270
RGNDATAHEADER rdh
Definition: region.h:15
#define SIMPLEREGION
Definition: wingdi.h:361
#define EMPTY_REGION(pReg)
Definition: region.c:149
#define DPRINT1
Definition: precomp.h:8
RECTL Rect
Definition: ntgdihdl.h:271
struct _REGION * PREGION
POBJ NTAPI GDIOBJ_AllocateObject(UCHAR objt, ULONG cjSize, FLONG fl)
Definition: gdiobj.c:559
VOID NTAPI GDIOBJ_vFreeObject(POBJ pobj)
Definition: gdiobj.c:593
HGDIOBJ NTAPI GDIOBJ_hInsertObject(POBJ pobj, ULONG ulOwner)
Definition: gdiobj.c:909

Referenced by REGION_AllocUserRgnWithHandle(), and REGION_XorRegion().

◆ REGION_AllocUserRgnWithHandle()

PREGION FASTCALL REGION_AllocUserRgnWithHandle ( INT  n)

Definition at line 2313 of file region.c.

2315 {
2316  PREGION prgn;
2317 
2318  prgn = REGION_AllocRgnWithHandle(nRgn);
2319  if (prgn == NULL)
2320  {
2321  return NULL;
2322  }
2323 
2324  if (!REGION_bAllocRgnAttr(prgn))
2325  {
2326  ASSERT(FALSE);
2327  }
2328 
2329  return prgn;
2330 }
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
BOOL NTAPI REGION_bAllocRgnAttr(PREGION prgn)
Definition: region.c:2279
PREGION FASTCALL REGION_AllocRgnWithHandle(INT nReg)
Definition: region.c:2219

Referenced by GreCreateFrameRgn(), GreCreatePolyPolygonRgn(), NtGdiCreateRectRgn(), NtGdiCreateRoundRectRgn(), NtGdiExtCreateRegion(), and NtGdiPathToRegion().

◆ REGION_bOffsetRgn()

BOOL FASTCALL REGION_bOffsetRgn ( _Inout_ PREGION  prgn,
_In_ INT  cx,
_In_ INT  cy 
)

Definition at line 2727 of file region.c.

2731 {
2732  PRECTL prcl;
2733  UINT i;
2734 
2735  NT_ASSERT(prgn != NULL);
2736 
2737  /* Check for trivial case */
2738  if ((cx == 0) && (cy == 0))
2739  {
2740  return TRUE;
2741  }
2742 
2743  /* Check for empty regions, we ignore the offset values here */
2744  if (prgn->rdh.nCount == 0)
2745  {
2746  return TRUE;
2747  }
2748 
2749  /* Make sure the offset is within the legal range */
2750  if ((cx > MAX_COORD) || (cx < MIN_COORD) ||
2751  (cy > MAX_COORD) || (cy < MIN_COORD))
2752  {
2753  return FALSE;
2754  }
2755 
2756  /* Are we moving right? */
2757  if (cx > 0)
2758  {
2759  /* Check if we stay inside the bounds on the right side */
2760  if (prgn->rdh.rcBound.right > (MAX_COORD - cx))
2761  {
2762  return FALSE;
2763  }
2764  }
2765  else
2766  {
2767  /* Check if we stay inside the bounds on the left side */
2768  if (prgn->rdh.rcBound.left < (MIN_COORD - cx))
2769  {
2770  return FALSE;
2771  }
2772  }
2773 
2774  /* Are we moving down? */
2775  if (cy > 0)
2776  {
2777  /* Check if we stay inside the bounds on the right side */
2778  if (prgn->rdh.rcBound.bottom > (MAX_COORD - cy))
2779  {
2780  return FALSE;
2781  }
2782  }
2783  else
2784  {
2785  /* Check if we stay inside the bounds on the left side */
2786  if (prgn->rdh.rcBound.top < (MIN_COORD - cy))
2787  {
2788  return FALSE;
2789  }
2790  }
2791 
2792  /* Loop to move the rects */
2793  prcl = prgn->Buffer;
2794  for (i = 0; i < prgn->rdh.nCount; i++)
2795  {
2796  prcl[i].left += cx;
2797  prcl[i].right += cx;
2798  prcl[i].top += cy;
2799  prcl[i].bottom += cy;
2800  }
2801 
2802  /* Finally update the bounds rect */
2803  if (prgn->Buffer != &prgn->rdh.rcBound)
2804  {
2805  prgn->rdh.rcBound.left += cx;
2806  prgn->rdh.rcBound.right += cx;
2807  prgn->rdh.rcBound.top += cy;
2808  prgn->rdh.rcBound.bottom += cy;
2809  }
2810 
2811  return TRUE;
2812 }
#define TRUE
Definition: types.h:120
#define MAX_COORD
Definition: region.c:12
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
smooth NULL
Definition: ftsmooth.c:416
unsigned int UINT
Definition: ndis.h:50
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
Definition: winddi.h:3529
_Out_opt_ int * cx
Definition: commctrl.h:581
#define MIN_COORD
Definition: region.c:11
#define NT_ASSERT
Definition: rtlfuncs.h:3312

Referenced by CLIPPING_UpdateGCRegion(), co_IntGetUpdateRgn(), co_UserRedrawWindow(), co_VIS_WindowLayoutChanged(), co_WinPosSetWindowPos(), DceResetActiveDCEs(), GdiSelectVisRgn(), IntGdiBitBltRgn(), IntGdiFillRgn(), IntInvalidateWindows(), IntScrollWindowEx(), NtGdiGetRandomRgn(), NtGdiOffsetClipRgn(), NtGdiOffsetRgn(), REGION_bMakeFrameRegion(), REGION_bXformRgn(), UserScrollDC(), and VIS_ComputeVisibleRegion().

◆ REGION_bXformRgn()

BOOL FASTCALL REGION_bXformRgn ( _Inout_ PREGION  prgn,
_In_ PMATRIX  pmx 
)

Definition at line 2082 of file region.c.

2085 {
2086  XFORMOBJ xo;
2087  ULONG i, cjSize;
2088  PPOINT ppt;
2089  PULONG pcPoints;
2090  RECT rect;
2091  BOOL bResult;
2092 
2093  /* Check for zero rectangles and return TRUE for translation only matrices */
2094  if (prgn->rdh.nCount < 1)
2095  return (pmx->flAccel & XFORM_UNITY) != 0;
2096 
2097  /* Check if this is a scaling only matrix (off-diagonal elements are 0 */
2098  if (pmx->flAccel & XFORM_SCALE)
2099  {
2100  /* Check if this is a translation only matrix */
2101  if (pmx->flAccel & XFORM_UNITY)
2102  {
2103  /* Just offset the region */
2104  return REGION_bOffsetRgn(prgn, (pmx->fxDx + 8) / 16, (pmx->fxDy + 8) / 16);
2105  }
2106  else
2107  {
2108  /* Initialize the xform object */
2109  XFORMOBJ_vInit(&xo, pmx);
2110 
2111  /* Scaling can move the rects out of the coordinate space, so
2112  * we first need to check whether we can apply the transformation
2113  * on the bounds rect without modifying the region */
2114  if (!XFORMOBJ_bApplyXform(&xo, XF_LTOL, 2, &prgn->rdh.rcBound, &rect))
2115  {
2116  return FALSE;
2117  }
2118 
2119  /* Apply the xform to the rects in the region */
2120  if (!XFORMOBJ_bApplyXform(&xo,
2121  XF_LTOL,
2122  prgn->rdh.nCount * 2,
2123  prgn->Buffer,
2124  prgn->Buffer))
2125  {
2126  /* This can not happen, since we already checked the bounds! */
2127  NT_ASSERT(FALSE);
2128  }
2129 
2130  /* Reset bounds */
2131  RECTL_vSetEmptyRect(&prgn->rdh.rcBound);
2132 
2133  /* Loop all rects in the region */
2134  for (i = 0; i < prgn->rdh.nCount; i++)
2135  {
2136  /* Make sure the rect is well-ordered after the xform */
2137  RECTL_vMakeWellOrdered(&prgn->Buffer[i]);
2138 
2139  /* Update bounds */
2140  if (!RECTL_bUnionRect(&prgn->rdh.rcBound,
2141  &prgn->rdh.rcBound,
2142  &prgn->Buffer[i]))
2143  {
2144  DPRINT1("NULL Set in Union Rects\n");
2145  return FALSE;
2146  }
2147  }
2148 
2149  /* Loop all rects in the region */
2150  for (i = 0; i < prgn->rdh.nCount - 1; i++)
2151  {
2152  NT_ASSERT(prgn->Buffer[i].top <= prgn->Buffer[i].bottom);
2153  NT_ASSERT(prgn->Buffer[i + 1].top >= prgn->Buffer[i].top);
2154  }
2155 
2156  return TRUE;
2157  }
2158  }
2159  else
2160  {
2161  /* Allocate a buffer for the polygons */
2162  cjSize = prgn->rdh.nCount * (4 * sizeof(POINT) + sizeof(ULONG));
2164  if (ppt == NULL)
2165  {
2166  return FALSE;
2167  }
2168 
2169  /* Fill the buffer with the rects */
2170  pcPoints = (PULONG)&ppt[4 * prgn->rdh.nCount];
2171  for (i = 0; i < prgn->rdh.nCount; i++)
2172  {
2173  /* Make sure the rect is within the legal range */
2174  pcPoints[i] = 4;
2175  ppt[4 * i + 0].x = prgn->Buffer[i].left;
2176  ppt[4 * i + 0].y = prgn->Buffer[i].top;
2177  ppt[4 * i + 1].x = prgn->Buffer[i].right;
2178  ppt[4 * i + 1].y = prgn->Buffer[i].top;
2179  ppt[4 * i + 2].x = prgn->Buffer[i].right;
2180  ppt[4 * i + 2].y = prgn->Buffer[i].bottom;
2181  ppt[4 * i + 3].x = prgn->Buffer[i].left;
2182  ppt[4 * i + 3].y = prgn->Buffer[i].bottom;
2183  }
2184 
2185  /* Initialize the xform object */
2186  XFORMOBJ_vInit(&xo, pmx);
2187 
2188  /* Apply the xform to the rects in the buffer */
2189  if (!XFORMOBJ_bApplyXform(&xo,
2190  XF_LTOL,
2191  prgn->rdh.nCount * 2,
2192  ppt,
2193  ppt))
2194  {
2195  /* This means, there were coordinates that would go outside of
2196  the coordinate space after the transformation */
2198  return FALSE;
2199  }
2200 
2201  /* Now use the polygons to create a polygon region */
2202  bResult = REGION_SetPolyPolygonRgn(prgn,
2203  ppt,
2204  pcPoints,
2205  prgn->rdh.nCount,
2206  WINDING);
2207 
2208  /* Free the polygon buffer */
2210 
2211  return bResult;
2212  }
2213 
2214 }
#define WINDING
Definition: constants.h:279
#define TRUE
Definition: types.h:120
BOOL FASTCALL REGION_SetPolyPolygonRgn(_Inout_ PREGION prgn, _In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
Definition: region.c:3275
long y
Definition: polytest.cpp:48
FORCEINLINE VOID RECTL_vSetEmptyRect(_Out_ RECTL *prcl)
Definition: rect.h:20
#define XFORMOBJ_bApplyXform
Definition: xformobj.h:11
long x
Definition: polytest.cpp:48
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2727
FORCEINLINE VOID XFORMOBJ_vInit(OUT XFORMOBJ *pxo, IN MATRIX *pmx)
Definition: xformobj.h:21
& rect
Definition: startmenu.cpp:1413
#define GDITAG_REGION
Definition: tags.h:157
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define POINT
Definition: precomp.h:30
#define XF_LTOL
Definition: winddi.h:3109
BOOL FASTCALL RECTL_bUnionRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:18
#define for
Definition: utility.h:88
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
unsigned int * PULONG
Definition: retypes.h:1
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
_In_ ULONG cjSize
Definition: winddi.h:3634
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
#define NT_ASSERT
Definition: rtlfuncs.h:3312

Referenced by REGION_LPTODP().

◆ REGION_Complexity()

INT FASTCALL REGION_Complexity ( PREGION  )

Definition at line 567 of file region.c.

568 {
569  if (prgn == NULL)
570  return NULLREGION;
571 
572  DPRINT("Region Complexity -> %lu", prgn->rdh.nCount);
573  switch (prgn->rdh.nCount)
574  {
575  case 0:
576  return NULLREGION;
577  case 1:
578  return SIMPLEREGION;
579  default:
580  return COMPLEXREGION;
581  }
582 }
#define COMPLEXREGION
Definition: wingdi.h:362
#define NULLREGION
Definition: wingdi.h:360
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define SIMPLEREGION
Definition: wingdi.h:361

Referenced by _Success_(), co_WinPosSetWindowPos(), IntGdiCombineRgn(), IntGdiSetMetaRgn(), NtGdiOffsetClipRgn(), NtGdiOffsetRgn(), REGION_bMakeFrameRegion(), REGION_CropRegion(), REGION_GetRgnBox(), REGION_SubtractRectFromRgn(), and REGION_UnlockRgn().

◆ REGION_CropRegion()

INT FASTCALL REGION_CropRegion ( PREGION  rgnDst,
PREGION  rgnSrc,
const RECTL rect 
)

Definition at line 678 of file region.c.

682 {
683  PRECTL lpr, rpr;
684  ULONG i, j, clipa, clipb, nRgnSize;
685  INT left = MAXLONG;
686  INT right = MINLONG;
687  INT top = MAXLONG;
688  INT bottom = MINLONG;
689 
690  if ((rect->left >= rect->right) ||
691  (rect->top >= rect->bottom) ||
692  (EXTENTCHECK(rect, &rgnSrc->rdh.rcBound) == 0))
693  {
694  goto empty;
695  }
696 
697  /* Skip all rects that are completely above our intersect rect */
698  for (clipa = 0; clipa < rgnSrc->rdh.nCount; clipa++)
699  {
700  /* bottom is exclusive, so break when we go above it */
701  if (rgnSrc->Buffer[clipa].bottom > rect->top) break;
702  }
703 
704  /* Bail out, if there is nothing left */
705  if (clipa == rgnSrc->rdh.nCount) goto empty;
706 
707  /* Find the last rect that is still within the intersect rect (exclusive) */
708  for (clipb = clipa; clipb < rgnSrc->rdh.nCount; clipb++)
709  {
710  /* bottom is exclusive, so stop, when we start at that y pos */
711  if (rgnSrc->Buffer[clipb].top >= rect->bottom) break;
712  }
713 
714  /* Bail out, if there is nothing left */
715  if (clipb == clipa) goto empty;
716 
717  // clipa - index of the first rect in the first intersecting band
718  // clipb - index of the last rect in the last intersecting band plus 1
719 
720  /* Check if the buffer in the dest region is large enough,
721  otherwise allocate a new one */
722  nRgnSize = (clipb - clipa) * sizeof(RECT);
723  if ((rgnDst != rgnSrc) && (rgnDst->rdh.nRgnSize < nRgnSize))
724  {
725  PRECTL temp;
727  if (temp == NULL)
728  return ERROR;
729 
730  /* Free the old buffer */
731  if (rgnDst->Buffer && (rgnDst->Buffer != &rgnDst->rdh.rcBound))
733 
734  rgnDst->Buffer = temp;
735  rgnDst->rdh.nCount = 0;
736  rgnDst->rdh.nRgnSize = nRgnSize;
737  rgnDst->rdh.iType = RDH_RECTANGLES;
738  }
739 
740  /* Loop all rects within the intersect rect from the y perspective */
741  for (i = clipa, j = 0; i < clipb ; i++)
742  {
743  /* i - src index, j - dst index, j is always <= i for obvious reasons */
744 
745  lpr = &rgnSrc->Buffer[i];
746 
747  /* Make sure the source rect is not retarded */
748  ASSERT(lpr->bottom > lpr->top);
749  ASSERT(lpr->right > lpr->left);
750 
751  /* We already checked above, this should hold true */
752  ASSERT(lpr->bottom > rect->top);
753  ASSERT(lpr->top < rect->bottom);
754 
755  /* Check if this rect is really inside the intersect rect */
756  if ((lpr->left < rect->right) && (lpr->right > rect->left))
757  {
758  rpr = &rgnDst->Buffer[j];
759 
760  /* Crop the rect with the intersect rect */
761  rpr->top = max(lpr->top, rect->top);
762  rpr->bottom = min(lpr->bottom, rect->bottom);
763  rpr->left = max(lpr->left, rect->left);
764  rpr->right = min(lpr->right, rect->right);
765 
766  /* Make sure the resulting rect is not retarded */
767  ASSERT(rpr->bottom > rpr->top);
768  ASSERT(rpr->right > rpr->left);
769 
770  /* Track new bounds */
771  if (rpr->left < left) left = rpr->left;
772  if (rpr->right > right) right = rpr->right;
773  if (rpr->top < top) top = rpr->top;
774  if (rpr->bottom > bottom) bottom = rpr->bottom;
775 
776  /* Next target rect */
777  j++;
778  }
779  }
780 
781  if (j == 0) goto empty;
782 
783  /* Update the bounds rect */
784  rgnDst->rdh.rcBound.left = left;
785  rgnDst->rdh.rcBound.right = right;
786  rgnDst->rdh.rcBound.top = top;
787  rgnDst->rdh.rcBound.bottom = bottom;
788 
789  /* Set new rect count */
790  rgnDst->rdh.nCount = j;
791 
792  return REGION_Complexity(rgnDst);
793 
794 empty:
795  if (rgnDst->Buffer == NULL)
796  {
797  rgnDst->Buffer = &rgnDst->rdh.rcBound;
798  }
799 
800  EMPTY_REGION(rgnDst);
801  return NULLREGION;
802 }
#define max(a, b)
Definition: svc.c:63
#define MAXLONG
Definition: umtypes.h:116
#define ERROR(name)
Definition: error_private.h:53
#define TAG_REGION
Definition: tags.h:22
#define NULLREGION
Definition: wingdi.h:360
LONG top
Definition: windef.h:307
long bottom
Definition: polytest.cpp:53
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
long right
Definition: polytest.cpp:53
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
long top
Definition: polytest.cpp:53
RECTL * Buffer
Definition: region.h:16
smooth NULL
Definition: ftsmooth.c:416
GLint GLint bottom
Definition: glext.h:7726
long left
Definition: polytest.cpp:53
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define EXTENTCHECK(r1, r2)
Definition: region.c:167
#define RDH_RECTANGLES
Definition: wingdi.h:668
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define MINLONG
Definition: umtypes.h:115
RGNDATAHEADER rdh
Definition: region.h:15
#define EMPTY_REGION(pReg)
Definition: region.c:149
static calc_node_t temp
Definition: rpn_ieee.c:38
#define min(a, b)
Definition: monoChain.cc:55
BOOL empty
Definition: button.c:170
unsigned int ULONG
Definition: retypes.h:1
LONG bottom
Definition: windef.h:309
INT FASTCALL REGION_Complexity(PREGION prgn)
Definition: region.c:567
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by NtGdiIntersectClipRect().

◆ REGION_Delete()

◆ REGION_GetRgnBox()

INT FASTCALL REGION_GetRgnBox ( PREGION  Rgn,
RECTL pRect 
)

◆ REGION_LockRgn()

◆ REGION_PtInRegion()

BOOL FASTCALL REGION_PtInRegion ( PREGION  ,
INT  ,
INT   
)

Definition at line 2602 of file region.c.

2606 {
2607  ULONG i;
2608  PRECT r;
2609 
2610  if (prgn->rdh.nCount > 0 && INRECT(prgn->rdh.rcBound, X, Y))
2611  {
2612  r = prgn->Buffer;
2613  for (i = 0; i < prgn->rdh.nCount; i++)
2614  {
2615  if (INRECT(r[i], X, Y))
2616  return TRUE;
2617  }
2618  }
2619 
2620  return FALSE;
2621 }
#define TRUE
Definition: types.h:120
#define Y(I)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define INRECT(r, x, y)
Definition: region.c:158
unsigned int ULONG
Definition: retypes.h:1

Referenced by NtGdiExtFloodFill(), NtGdiPtInRegion(), and NtGdiPtVisible().

◆ REGION_RectInRegion()

BOOL FASTCALL REGION_RectInRegion ( PREGION  Rgn,
const RECTL rc 
)

Definition at line 2625 of file region.c.

2628 {
2629  PRECTL pCurRect, pRectEnd;
2630  RECT rc;
2631 
2632  /* Swap the coordinates to make right >= left and bottom >= top */
2633  /* (region building rectangles are normalized the same way) */
2634  if (rect->top > rect->bottom)
2635  {
2636  rc.top = rect->bottom;
2637  rc.bottom = rect->top;
2638  }
2639  else
2640  {
2641  rc.top = rect->top;
2642  rc.bottom = rect->bottom;
2643  }
2644 
2645  if (rect->right < rect->left)
2646  {
2647  rc.right = rect->left;
2648  rc.left = rect->right;
2649  }
2650  else
2651  {
2652  rc.right = rect->right;
2653  rc.left = rect->left;
2654  }
2655 
2656  /* This is (just) a useful optimization */
2657  if ((Rgn->rdh.nCount > 0) && EXTENTCHECK(&Rgn->rdh.rcBound, &rc))
2658  {
2659  for (pCurRect = Rgn->Buffer, pRectEnd = pCurRect +
2660  Rgn->rdh.nCount; pCurRect < pRectEnd; pCurRect++)
2661  {
2662  if (pCurRect->bottom <= rc.top)
2663  continue; /* Not far enough down yet */
2664 
2665  if (pCurRect->top >= rc.bottom)
2666  break; /* Too far down */
2667 
2668  if (pCurRect->right <= rc.left)
2669  continue; /* Not far enough over yet */
2670 
2671  if (pCurRect->left >= rc.right)
2672  {
2673  continue;
2674  }
2675 
2676  return TRUE;
2677  }
2678  }
2679 
2680  return FALSE;
2681 }
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:307
long bottom
Definition: polytest.cpp:53
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
& rect
Definition: startmenu.cpp:1413
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
RECTL * Buffer
Definition: region.h:16
long left
Definition: polytest.cpp:53
#define EXTENTCHECK(r1, r2)
Definition: region.c:167
RGNDATAHEADER rdh
Definition: region.h:15
LONG bottom
Definition: windef.h:309

Referenced by IntRectInRegion(), and NtGdiRectVisible().

◆ REGION_SetPolyPolygonRgn()

BOOL FASTCALL REGION_SetPolyPolygonRgn ( _Inout_ PREGION  prgn,
_In_ const POINT ppt,
_In_ const ULONG pcPoints,
_In_ ULONG  cPolygons,
_In_ INT  iMode 
)

Definition at line 3275 of file region.c.

3281 {
3282  EDGE_TABLE_ENTRY *pAET; /* Active Edge Table */
3283  INT y; /* Current scanline */
3284  INT iPts = 0; /* Number of pts in buffer */
3285  EDGE_TABLE_ENTRY *pWETE; /* Winding Edge Table Entry */
3286  SCANLINE_LIST *pSLL; /* Current SCANLINE_LIST */
3287  POINT *pts; /* Output buffer */
3288  EDGE_TABLE_ENTRY *pPrevAET; /* Pointer to previous AET */
3289  EDGE_TABLE ET; /* Header node for ET */
3290  EDGE_TABLE_ENTRY AET; /* Header node for AET */
3291  EDGE_TABLE_ENTRY *pETEs; /* EDGE_TABLEEntries pool */
3292  SCANLINE_LISTBLOCK SLLBlock; /* Header for SCANLINE_LIST */
3293  INT fixWAET = FALSE;
3294  POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
3295  POINTBLOCK *tmpPtBlock;
3296  UINT numFullPtBlocks = 0;
3297  UINT poly, total;
3298 
3299  /* Check if iMode is valid */
3300  if ((iMode != ALTERNATE) && (iMode != WINDING))
3301  {
3302  DPRINT1("Invalid iMode: %lu\n", iMode);
3303  return FALSE;
3304  }
3305 
3306  /* Special case a rectangle */
3307  if (((cPolygons == 1) && ((pcPoints[0] == 4) ||
3308  ((pcPoints[0] == 5) && (ppt[4].x == ppt[0].x) && (ppt[4].y == ppt[0].y)))) &&
3309  (((ppt[0].y == ppt[1].y) &&
3310  (ppt[1].x == ppt[2].x) &&
3311  (ppt[2].y == ppt[3].y) &&
3312  (ppt[3].x == ppt[0].x)) ||
3313  ((ppt[0].x == ppt[1].x) &&
3314  (ppt[1].y == ppt[2].y) &&
3315  (ppt[2].x == ppt[3].x) &&
3316  (ppt[3].y == ppt[0].y))))
3317  {
3318  REGION_SetRectRgn(prgn,
3319  min(ppt[0].x, ppt[2].x),
3320  min(ppt[0].y, ppt[2].y),
3321  max(ppt[0].x, ppt[2].x),
3322  max(ppt[0].y, ppt[2].y));
3323  return TRUE;
3324  }
3325 
3326  for (poly = total = 0; poly < cPolygons; poly++)
3327  total += pcPoints[poly];
3328 
3330  sizeof(EDGE_TABLE_ENTRY) * total,
3331  TAG_REGION);
3332  if (pETEs == NULL)
3333  {
3334  DPRINT1("Failed to allocate %lu edge entries\n", total);
3335  return FALSE;
3336  }
3337 
3338  pts = FirstPtBlock.pts;
3339  REGION_CreateETandAET(pcPoints, cPolygons, ppt, &ET, &AET, pETEs, &SLLBlock);
3340  pSLL = ET.scanlines.next;
3341  curPtBlock = &FirstPtBlock;
3342 
3343  if (iMode != WINDING)
3344  {
3345  /* For each scanline */
3346  for (y = ET.ymin; y < ET.ymax; y++)
3347  {
3348  /* Add a new edge to the active edge table when we
3349  * get to the next edge. */
3350  if (pSLL != NULL && y == pSLL->scanline)
3351  {
3352  REGION_loadAET(&AET, pSLL->edgelist);
3353  pSLL = pSLL->next;
3354  }
3355  pPrevAET = &AET;
3356  pAET = AET.next;
3357 
3358  /* For each active edge */
3359  while (pAET)
3360  {
3361  pts->x = pAET->bres.minor_axis, pts->y = y;
3362  pts++, iPts++;
3363 
3364  /* Send out the buffer */
3365  if (iPts == NUMPTSTOBUFFER)
3366  {
3367  tmpPtBlock = ExAllocatePoolWithTag(PagedPool,
3368  sizeof(POINTBLOCK),
3369  TAG_REGION);
3370  if (tmpPtBlock == NULL)
3371  {
3372  DPRINT1("Can't alloc tmpPtBlock\n");
3373  ExFreePoolWithTag(pETEs, TAG_REGION);
3374  return FALSE;
3375  }
3376 
3377  curPtBlock->next = tmpPtBlock;
3378  curPtBlock = tmpPtBlock;
3379  pts = curPtBlock->pts;
3380  numFullPtBlocks++;
3381  iPts = 0;
3382  }
3383 
3384  EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
3385  }
3386 
3387  REGION_InsertionSort(&AET);
3388  }
3389  }
3390  else
3391  {
3392  /* For each scanline */
3393  for (y = ET.ymin; y < ET.ymax; y++)
3394  {
3395  /* Add a new edge to the active edge table when we
3396  * get to the next edge. */
3397  if (pSLL != NULL && y == pSLL->scanline)
3398  {
3399  REGION_loadAET(&AET, pSLL->edgelist);
3400  REGION_computeWAET(&AET);
3401  pSLL = pSLL->next;
3402  }
3403 
3404  pPrevAET = &AET;
3405  pAET = AET.next;
3406  pWETE = pAET;
3407 
3408  /* For each active edge */
3409  while (pAET)
3410  {
3411  /* Add to the buffer only those edges that
3412  * are in the Winding active edge table. */
3413  if (pWETE == pAET)
3414  {
3415  pts->x = pAET->bres.minor_axis;
3416  pts->y = y;
3417  pts++;
3418  iPts++;
3419 
3420  /* Send out the buffer */
3421  if (iPts == NUMPTSTOBUFFER)
3422  {
3423  tmpPtBlock = ExAllocatePoolWithTag(PagedPool,
3424  sizeof(POINTBLOCK),
3425  TAG_REGION);
3426  if (tmpPtBlock == NULL)
3427  {
3428  DPRINT1("Can't alloc tPB\n");
3429  ExFreePoolWithTag(pETEs, TAG_REGION);
3430  return FALSE;
3431  }
3432  curPtBlock->next = tmpPtBlock;
3433  curPtBlock = tmpPtBlock;
3434  pts = curPtBlock->pts;
3435  numFullPtBlocks++;
3436  iPts = 0;
3437  }
3438 
3439  pWETE = pWETE->nextWETE;
3440  }
3441 
3442  EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
3443  }
3444 
3445  /* Recompute the winding active edge table if
3446  * we just resorted or have exited an edge. */
3447  if (REGION_InsertionSort(&AET) || fixWAET)
3448  {
3449  REGION_computeWAET(&AET);
3450  fixWAET = FALSE;
3451  }
3452  }
3453  }
3454 
3455  REGION_FreeStorage(SLLBlock.next);
3456  REGION_PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, prgn);
3457 
3458  for (curPtBlock = FirstPtBlock.next; numFullPtBlocks-- > 0;)
3459  {
3460  tmpPtBlock = curPtBlock->next;
3461  ExFreePoolWithTag(curPtBlock, TAG_REGION);
3462  curPtBlock = tmpPtBlock;
3463  }
3464 
3465  ExFreePoolWithTag(pETEs, TAG_REGION);
3466  return TRUE;
3467 }
#define max(a, b)
Definition: svc.c:63
#define WINDING
Definition: constants.h:279
#define TRUE
Definition: types.h:120
static VOID FASTCALL REGION_loadAET(EDGE_TABLE_ENTRY *AET, EDGE_TABLE_ENTRY *ETEs)
Definition: region.c:2904
long y
Definition: polytest.cpp:48
_In_ ULONG iMode
Definition: winddi.h:3520
long x
Definition: polytest.cpp:48
EDGE_TABLE_ENTRY * edgelist
Definition: region.c:331
#define TAG_REGION
Definition: tags.h:22
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
struct _SCANLINE_LIST * next
Definition: region.c:332
Definition: bidi.c:79
int32_t INT
Definition: typedefs.h:56
struct _POINTBLOCK * next
Definition: region.c:532
static INT FASTCALL REGION_PtsToRegion(INT numFullPtBlocks, INT iCurPtBlock, POINTBLOCK *FirstPtBlock, PREGION reg)
Definition: region.c:3063
struct _EDGE_TABLE_ENTRY * nextWETE
Definition: region.c:323
#define ALTERNATE
Definition: constants.h:278
smooth NULL
Definition: ftsmooth.c:416
Definition: region.c:317
INT minor_axis
Definition: region.c:249
POINT pts[NUMPTSTOBUFFER]
Definition: region.c:531
static VOID FASTCALL REGION_CreateETandAET(const ULONG *Count, INT nbpolygons, const POINT *pts, EDGE_TABLE *ET, EDGE_TABLE_ENTRY *AET, EDGE_TABLE_ENTRY *pETEs, SCANLINE_LISTBLOCK *pSLLBlock)
Definition: region.c:3189
struct _SCANLINE_LISTBLOCK * next
Definition: region.c:354
static VOID FASTCALL REGION_computeWAET(EDGE_TABLE_ENTRY *AET)
Definition: region.c:2957
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static BOOL FASTCALL REGION_InsertionSort(EDGE_TABLE_ENTRY *AET)
Definition: region.c:2998
#define NUMPTSTOBUFFER
Definition: region.c:524
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
Definition: region.c:393
static VOID FASTCALL REGION_FreeStorage(SCANLINE_LISTBLOCK *pSLLBlock)
Definition: region.c:3041
BRESINFO bres
Definition: region.c:320
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define DPRINT1
Definition: precomp.h:8
INT scanline
Definition: region.c:330
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET)
Definition: region.c:370
struct _EDGE_TABLE_ENTRY * next
Definition: region.c:321
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
VOID FASTCALL REGION_SetRectRgn(PREGION rgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2685

Referenced by GreCreatePolyPolygonRgn(), PATH_PathToRegion(), and REGION_bXformRgn().

◆ REGION_SetRectRgn()

VOID FASTCALL REGION_SetRectRgn ( PREGION  pRgn,
INT  LeftRect,
INT  TopRect,
INT  RightRect,
INT  BottomRect 
)

Definition at line 2685 of file region.c.

2691 {
2692  PRECTL firstRect;
2693 
2694  if (LeftRect > RightRect)
2695  {
2696  INT tmp = LeftRect;
2697  LeftRect = RightRect;
2698  RightRect = tmp;
2699  }
2700 
2701  if (TopRect > BottomRect)
2702  {
2703  INT tmp = TopRect;
2704  TopRect = BottomRect;
2705  BottomRect = tmp;
2706  }
2707 
2708  if ((LeftRect != RightRect) && (TopRect != BottomRect))
2709  {
2710  firstRect = rgn->Buffer;
2711  ASSERT(firstRect);
2712  firstRect->left = rgn->rdh.rcBound.left = LeftRect;
2713  firstRect->top = rgn->rdh.rcBound.top = TopRect;
2714  firstRect->right = rgn->rdh.rcBound.right = RightRect;
2715  firstRect->bottom = rgn->rdh.rcBound.bottom = BottomRect;
2716  rgn->rdh.nCount = 1;
2717  rgn->rdh.iType = RDH_RECTANGLES;
2718  }
2719  else
2720  {
2721  EMPTY_REGION(rgn);
2722  }
2723 }
long bottom
Definition: polytest.cpp:53
int32_t INT
Definition: typedefs.h:56
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
#define RDH_RECTANGLES
Definition: wingdi.h:668
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define EMPTY_REGION(pReg)
Definition: region.c:149

Referenced by co_IntGetUpdateRgn(), IntSetDefaultRegion(), IntSysCreateRectpRgn(), NtGdiCreateRectRgn(), NtGdiSelectBitmap(), NtGdiSetRectRgn(), REGION_SetPolyPolygonRgn(), REGION_vSyncRegion(), and UserScrollDC().

◆ REGION_SubtractRectFromRgn()

INT FASTCALL REGION_SubtractRectFromRgn ( PREGION  prgnDest,
PREGION  prgnSrc,
const RECTL prcl 
)

Definition at line 1827 of file region.c.

1831 {
1832  REGION rgnLocal;
1833 
1834  rgnLocal.Buffer = &rgnLocal.rdh.rcBound;
1835  rgnLocal.rdh.nCount = 1;
1836  rgnLocal.rdh.nRgnSize = sizeof(RECT);
1837  rgnLocal.rdh.rcBound = *prcl;
1838  REGION_SubtractRegion(prgnDest, prgnSrc, &rgnLocal);
1839  return REGION_Complexity(prgnDest);
1840 }
struct tagRECT RECT
RECTL * Buffer
Definition: region.h:16
Definition: region.h:7
static BOOL FASTCALL REGION_SubtractRegion(PREGION regD, PREGION regM, PREGION regS)
Definition: region.c:1732
RGNDATAHEADER rdh
Definition: region.h:15
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
Definition: winddi.h:3529
INT FASTCALL REGION_Complexity(PREGION prgn)
Definition: region.c:567

Referenced by NtGdiExcludeClipRect().

◆ REGION_UnionRectWithRgn()

BOOL FASTCALL REGION_UnionRectWithRgn ( PREGION  rgn,
const RECTL rect 
)

Adds a rectangle to a REGION

Definition at line 1812 of file region.c.

1815 {
1816  REGION region;
1817 
1818  region.Buffer = &region.rdh.rcBound;
1819  region.rdh.nCount = 1;
1820  region.rdh.nRgnSize = sizeof(RECT);
1821  region.rdh.rcBound = *rect;
1822  return REGION_UnionRegion(rgn, rgn, &region);
1823 }
& rect
Definition: startmenu.cpp:1413
struct tagRECT RECT
RECTL * Buffer
Definition: region.h:16
Definition: region.h:7
static BOOL FASTCALL REGION_UnionRegion(PREGION newReg, PREGION reg1, PREGION reg2)
Definition: region.c:1478
RGNDATAHEADER rdh
Definition: region.h:15

Referenced by NtGdiExtCreateRegion().

◆ REGION_UnlockRgn()

VOID FASTCALL REGION_UnlockRgn ( _In_ PREGION  prgn)

Definition at line 2392 of file region.c.

2394 {
2395  PRGN_ATTR prgnattr;
2396 
2397  NT_ASSERT(prgn != NULL);
2398  NT_ASSERT(prgn->prgnattr != NULL);
2399 
2400  /* Get the region attribute and check if it's user mode */
2401  prgnattr = prgn->prgnattr;
2402  if (prgnattr != &prgn->rgnattr)
2403  {
2404  NT_ASSERT(GreGetObjectOwner(prgn->BaseObject.hHmgr) == GDI_OBJ_HMGR_POWNED);
2405  prgnattr->iComplexity = REGION_Complexity(prgn);
2406  prgnattr->Rect.left = prgn->rdh.rcBound.left;
2407  prgnattr->Rect.top = prgn->rdh.rcBound.top;
2408  prgnattr->Rect.right = prgn->rdh.rcBound.right;
2409  prgnattr->Rect.bottom = prgn->rdh.rcBound.bottom;
2410  prgnattr->AttrFlags |= ATTR_RGN_VALID;
2411  }
2412 
2413  GDIOBJ_vUnlockObject(&prgn->BaseObject);
2414 }
long bottom
Definition: polytest.cpp:53
ULONG NTAPI GreGetObjectOwner(HGDIOBJ hobj)
Definition: gdiobj.c:1189
#define ATTR_RGN_VALID
Definition: ntgdihdl.h:210
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:416
ULONG AttrFlags
Definition: ntgdihdl.h:269
long left
Definition: polytest.cpp:53
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:877
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
ULONG iComplexity
Definition: ntgdihdl.h:270
RECTL Rect
Definition: ntgdihdl.h:271
INT FASTCALL REGION_Complexity(PREGION prgn)
Definition: region.c:567
#define NT_ASSERT
Definition: rtlfuncs.h:3312

Referenced by _Success_(), co_IntGetUpdateRgn(), co_WinPosSetWindowPos(), DceUpdateVisRgn(), ForceNCPaintErase(), GreCreateFrameRgn(), GreCreatePolyPolygonRgn(), IntDefWindowProc(), IntGdiGetRgnBox(), IntGdiSetRegionOwner(), IntInvalidateWindows(), IntRectInRegion(), IntScrollWindowEx(), IntValidateParents(), NtGdiCombineRgn(), NtGdiCreateRectRgn(), NtGdiCreateRoundRectRgn(), NtGdiEqualRgn(), NtGdiExtCreateRegion(), NtGdiExtSelectClipRgn(), NtGdiFillRgn(), NtGdiGetRandomRgn(), NtGdiGetRgnBox(), NtGdiInvertRgn(), NtGdiOffsetRgn(), NtGdiPathToRegion(), NtGdiPtInRegion(), NtGdiSetRectRgn(), NtUserCallHwndParamLock(), NtUserRedrawWindow(), PaintSuspendedWindow(), REGION_XorRegion(), UserScrollDC(), and VIS_ComputeVisibleRegion().

◆ REGION_vCleanup()

VOID NTAPI REGION_vCleanup ( PVOID  ObjectBody)

Definition at line 2452 of file region.c.

2453 {
2454  PREGION pRgn = (PREGION)ObjectBody;
2456  ASSERT(ppi);
2457 
2458  ASSERT(pRgn->prgnattr);
2459  if (pRgn->prgnattr != &pRgn->rgnattr)
2460  GdiPoolFree(ppi->pPoolRgnAttr, pRgn->prgnattr);
2461 
2462  if (pRgn->Buffer && pRgn->Buffer != &pRgn->rdh.rcBound)
2464 }
VOID NTAPI GdiPoolFree(PGDI_POOL pPool, PVOID pvAlloc)
Definition: gdipool.c:233
#define TAG_REGION
Definition: tags.h:22
_Notnull_ PRGN_ATTR prgnattr
Definition: region.h:12
RECTL * Buffer
Definition: region.h:16
Definition: region.h:7
RGN_ATTR rgnattr
Definition: region.h:13
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
RGNDATAHEADER rdh
Definition: region.h:15
struct _GDI_POOL * pPoolRgnAttr
Definition: win32.h:284
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
struct _REGION * PREGION
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Variable Documentation

◆ hrgnDefault

HRGN hrgnDefault

Definition at line 131 of file region.c.

◆ prgnDefault

PREGION prgnDefault

Definition at line 130 of file region.c.

Referenced by DC_InitHack(), IntGdiReleaseVisRgn(), IntSetDefaultRegion(), and REGION_Delete().