136 #define COPY_RECTS(dest, src, nRects) \ 138 PRECTL xDest = (dest); \ 139 PRECTL xSrc = (src); \ 140 UINT xRects = (nRects); \ 141 while (xRects-- > 0) { \ 142 *(xDest++) = *(xSrc++); \ 146 #define COPY_RECTS(dest, src, nRects) RtlCopyMemory(dest, src, (nRects) * sizeof(RECTL)) 149 #define EMPTY_REGION(pReg) { \ 150 (pReg)->rdh.nCount = 0; \ 151 (pReg)->rdh.rcBound.left = (pReg)->rdh.rcBound.top = 0; \ 152 (pReg)->rdh.rcBound.right = (pReg)->rdh.rcBound.bottom = 0; \ 153 (pReg)->rdh.iType = RDH_RECTANGLES; \ 156 #define REGION_NOT_EMPTY(pReg) pReg->rdh.nCount 158 #define INRECT(r, x, y) \ 159 ( ( ((r).right > x)) && \ 160 ( ((r).left <= x)) && \ 161 ( ((r).bottom > y)) && \ 167 #define EXTENTCHECK(r1, r2) \ 168 ((r1)->right > (r2)->left && \ 169 (r1)->left < (r2)->right && \ 170 (r1)->bottom > (r2)->top && \ 171 (r1)->top < (r2)->bottom) 192 #define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \ 201 dx = (x2) - xStart; \ 205 incr1 = -2 * dx + 2 * (dy) * m1; \ 206 incr2 = -2 * dx + 2 * (dy) * m; \ 207 d = 2 * m * (dy) - 2 * dx - 2 * (dy); \ 211 incr1 = 2 * dx - 2 * (dy) * m1; \ 212 incr2 = 2 * dx - 2 * (dy) * m; \ 213 d = -2 * m * (dy) + 2 * dx; \ 218 #define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \ 256 #define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \ 257 BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \ 258 bres.m, bres.m1, bres.incr1, bres.incr2) 260 #define BRESINCRPGONSTRUCT(bres) \ 261 BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2) 315 #define COUNTERCLOCKWISE -1 349 #define SLLSPERBLOCK 25 370 #define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \ 371 if (pAET->ymax == y) { \ 372 pPrevAET->next = pAET->next; \ 373 pAET = pPrevAET->next; \ 376 pAET->back = pPrevAET; \ 379 BRESINCRPGONSTRUCT(pAET->bres); \ 393 #define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \ 394 if (pAET->ymax == y) { \ 395 pPrevAET->next = pAET->next; \ 396 pAET = pPrevAET->next; \ 398 pAET->back = pPrevAET; \ 401 BRESINCRPGONSTRUCT(pAET->bres); \ 413 #define LARGE_COORDINATE INT_MAX 414 #define SMALL_COORDINATE INT_MIN 433 cjNewSize = cRects *
sizeof(
RECTL);
438 if (2 * prgn->rdh.nRgnSize > cjNewSize)
440 cjNewSize = 2 * prgn->rdh.nRgnSize;
445 if (pvBuffer ==
NULL)
451 COPY_RECTS(pvBuffer, prgn->Buffer, prgn->rdh.nCount);
454 if (prgn->Buffer != &prgn->rdh.rcBound)
460 prgn->Buffer = pvBuffer;
461 prgn->rdh.nRgnSize = cjNewSize;
473 if (cRects > prgn->rdh.nRgnSize /
sizeof(
RECTL))
492 NT_ASSERT((prgn->rdh.nCount + 1) *
sizeof(
RECT) <= prgn->rdh.nRgnSize);
494 prcl = &prgn->Buffer[prgn->rdh.nCount];
524 #define NUMPTSTOBUFFER 200 526 #define RGN_DEFAULT_RECTS 2 541 IntDumpRegion(HRGN
hRgn)
548 DbgPrint(
"IntDumpRegion called with invalid region!\n");
552 DbgPrint(
"IntDumpRegion(%x): %d,%d-%d,%d %d\n",
554 Data->rdh.rcBound.left,
555 Data->rdh.rcBound.top,
556 Data->rdh.rcBound.right,
557 Data->rdh.rcBound.bottom,
595 if (
dst->rdh.nRgnSize <
src->rdh.nCount *
sizeof(
RECT))
601 src->rdh.nCount *
sizeof(
RECT),
607 if ((
dst->Buffer !=
NULL) && (
dst->Buffer != &
dst->rdh.rcBound))
612 dst->rdh.nRgnSize =
src->rdh.nCount *
sizeof(
RECT);
615 dst->rdh.nCount =
src->rdh.nCount;
616 dst->rdh.rcBound.left =
src->rdh.rcBound.left;
617 dst->rdh.rcBound.top =
src->rdh.rcBound.top;
618 dst->rdh.rcBound.right =
src->rdh.rcBound.right;
619 dst->rdh.rcBound.bottom =
src->rdh.rcBound.bottom;
620 dst->rdh.iType =
src->rdh.iType;
633 RECTL *pRect, *pRectEnd, *pExtents;
656 pExtents->
top = pRect->
top;
660 while (pRect <= pRectEnd)
684 ULONG i,
j, clipa, clipb, nRgnSize;
698 for (clipa = 0; clipa < rgnSrc->
rdh.
nCount; clipa++)
708 for (clipb = clipa; clipb < rgnSrc->
rdh.
nCount; clipb++)
715 if (clipb == clipa)
goto empty;
722 nRgnSize = (clipb - clipa) *
sizeof(
RECT);
723 if ((rgnDst != rgnSrc) && (rgnDst->
rdh.
nRgnSize < nRgnSize))
741 for (
i = clipa,
j = 0;
i < clipb ;
i++)
835 pPrevRect = pReg->
Buffer + prevStart;
836 prevNumRects = curStart - prevStart;
841 pCurRect = pReg->
Buffer + curStart;
842 bandtop = pCurRect->
top;
843 for (curNumRects = 0;
844 (pCurRect != pRegEnd) && (pCurRect->
top == bandtop);
850 if (pCurRect != pRegEnd)
857 while ((pRegEnd-1)->top == pRegEnd->
top)
862 curStart = pRegEnd - pReg->
Buffer;
866 if ((curNumRects == prevNumRects) && (curNumRects != 0))
868 pCurRect -= curNumRects;
880 if ((pPrevRect->
left != pCurRect->
left) ||
891 while (prevNumRects != 0);
894 pCurRect -= curNumRects;
895 pPrevRect -= curNumRects;
907 while (curNumRects != 0);
917 if (pCurRect == pRegEnd)
919 curStart = prevStart;
925 *pPrevRect++ = *pCurRect++;
927 while (pCurRect != pRegEnd);
996 oldRects = newReg->
Buffer;
1049 while ((r1BandEnd != r1End) && (r1BandEnd->
top ==
r1->top))
1055 while ((r2BandEnd != r2End) && (r2BandEnd->
top ==
r2->top))
1066 if (
r1->top <
r2->top)
1069 bot =
min(
r1->bottom,
r2->top);
1071 if ((
top != bot) && (nonOverlap1Func !=
NULL))
1073 if (!(*nonOverlap1Func)(newReg,
r1, r1BandEnd,
top, bot))
return FALSE;
1078 else if (
r2->top <
r1->top)
1081 bot =
min(
r2->bottom,
r1->top);
1083 if ((
top != bot) && (nonOverlap2Func !=
NULL))
1085 if (!(*nonOverlap2Func)(newReg,
r2, r2BandEnd,
top, bot) )
return FALSE;
1106 ybot =
min(
r1->bottom,
r2->bottom);
1110 if (!(*overlapFunc)(newReg,
r1, r1BandEnd,
r2, r2BandEnd, ytop, ybot))
return FALSE;
1120 if (
r1->bottom == ybot)
1124 if (
r2->bottom == ybot)
1129 while ((
r1 != r1End) && (
r2 != r2End));
1135 if (nonOverlap1Func !=
NULL)
1140 while ((r1BandEnd < r1End) && (r1BandEnd->
top ==
r1->top))
1145 if (!(*nonOverlap1Func)(newReg,
1153 while (
r1 != r1End);
1156 else if ((
r2 != r2End) && (nonOverlap2Func !=
NULL))
1161 while ((r2BandEnd < r2End) && (r2BandEnd->
top ==
r2->top))
1166 if (!(*nonOverlap2Func)(newReg,
1174 while (
r2 != r2End);
1200 newReg->
Buffer = prev_rects;
1261 while ((
r1 != r1End) && (
r2 != r2End))
1282 if (
r1->right <
r2->right)
1286 else if (
r2->right <
r1->right)
1392 if ((prgn->rdh.nCount != 0) &&
1393 (prgn->Buffer[prgn->rdh.nCount - 1].top ==
top) &&
1394 (prgn->Buffer[prgn->rdh.nCount - 1].bottom ==
bottom) &&
1395 (prgn->Buffer[prgn->rdh.nCount - 1].right >=
left))
1397 if (prgn->Buffer[prgn->rdh.nCount - 1].right <
right)
1399 prgn->Buffer[prgn->rdh.nCount - 1].right =
right;
1437 while ((
r1 != r1End) && (
r2 != r2End))
1439 if (
r1->left <
r2->left)
1458 while (
r1 != r1End);
1487 if ((reg1 == reg2) || (reg1->
rdh.
nCount == 0) ||
1628 while ((
r1 != r1End) && (
r2 != r2End))
1635 else if (
r2->left <=
left)
1654 else if (
r2->left <
r1->right)
1712 while (
r1 != r1End);
1859 if ( !newReg || !reg1 || !reg2 )
return FALSE;
1887 prgn->rdh.nCount = 1;
1934 prgn->rdh.nCount =
i;
1936 prgn->rdh.nRgnSize = prgn->rdh.nCount *
sizeof(
RECT);
1937 NT_ASSERT(prgn->Buffer == &prgn->rdh.rcBound);
1941 if (prgn->Buffer ==
NULL)
1943 prgn->rdh.nRgnSize = 0;
1948 COPY_RECTS(prgn->Buffer, arcl, prgn->rdh.nCount);
1979 if ((
cx == 0) && (
cy == 0))
1992 if ((prgnSrc->rdh.rcBound.left < (
MIN_COORD +
cx)) ||
1994 (prgnSrc->rdh.rcBound.right > (
MAX_COORD -
cx)) ||
2051 if (prgnFrame ==
NULL)
2059 if (prgnSrc ==
NULL)
2094 if (prgn->rdh.nCount < 1)
2122 prgn->rdh.nCount * 2,
2134 for (
i = 0;
i < prgn->rdh.nCount;
i++)
2144 DPRINT1(
"NULL Set in Union Rects\n");
2150 for (
i = 0;
i < prgn->rdh.nCount - 1;
i++)
2152 NT_ASSERT(prgn->Buffer[
i].top <= prgn->Buffer[
i].bottom);
2153 NT_ASSERT(prgn->Buffer[
i + 1].top >= prgn->Buffer[
i].top);
2170 pcPoints = (
PULONG)&ppt[4 * prgn->rdh.nCount];
2171 for (
i = 0;
i < prgn->rdh.nCount;
i++)
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;
2191 prgn->rdh.nCount * 2,
2230 DPRINT1(
"Could not allocate a palette.\n");
2236 if ((nReg == 0) || (nReg == 1))
2245 nReg *
sizeof(
RECT),
2249 DPRINT1(
"Could not allocate region buffer\n");
2269 DPRINT1(
"Could not insert palette into handle table.\n");
2291 if (prgnattr ==
NULL)
2293 DPRINT1(
"Could not allocate RGN attr\n");
2341 NT_ASSERT((prgn->prgnattr == &prgn->rgnattr) ||
2345 prgnattr = prgn->prgnattr;
2366 DPRINT1(
"Region attribute is corrupted, ignoring\n");
2401 prgnattr = prgn->prgnattr;
2402 if (prgnattr != &prgn->rgnattr)
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;
2491 if (prgnattr != &prgn->
rgnattr)
2514 if (prgnDest ==
NULL)
2516 DPRINT(
"IntGdiCombineRgn: hDest unavailable\n");
2520 if (prgnSrc1 ==
NULL)
2522 DPRINT(
"IntGdiCombineRgn: hSrc1 unavailable\n");
2534 if (prgnSrc2 ==
NULL)
2536 DPRINT1(
"IntGdiCombineRgn requires hSrc2 != NULL for combine mode %d!\n", iCombineMode);
2541 switch (iCombineMode)
2629 PRECTL pCurRect, pRectEnd;
2659 for (pCurRect = Rgn->
Buffer, pRectEnd = pCurRect +
2660 Rgn->
rdh.
nCount; pCurRect < pRectEnd; pCurRect++)
2694 if (LeftRect > RightRect)
2697 LeftRect = RightRect;
2701 if (TopRect > BottomRect)
2704 TopRect = BottomRect;
2708 if ((LeftRect != RightRect) && (TopRect != BottomRect))
2738 if ((
cx == 0) && (
cy == 0))
2744 if (prgn->rdh.nCount == 0)
2793 prcl = prgn->Buffer;
2794 for (
i = 0;
i < prgn->rdh.nCount;
i++)
2803 if (prgn->Buffer != &prgn->rdh.rcBound)
2805 prgn->rdh.rcBound.left +=
cx;
2806 prgn->rdh.rcBound.right +=
cx;
2807 prgn->rdh.rcBound.top +=
cy;
2808 prgn->rdh.rcBound.bottom +=
cy;
2838 pPrevSLL = &
ET->scanlines;
2839 pSLL = pPrevSLL->
next;
2840 while (pSLL && (pSLL->
scanline < scanline))
2847 if ((!pSLL) || (pSLL->
scanline > scanline))
2854 if (tmpSLLBlock ==
NULL)
2856 DPRINT1(
"REGION_InsertEdgeInETL(): Can't alloc SLLB\n");
2861 (*SLLBlock)->next = tmpSLLBlock;
2863 *SLLBlock = tmpSLLBlock;
2867 pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
2871 pPrevSLL->
next = pSLL;
2926 ETEs->
back = pPrevAET;
2927 pPrevAET->
next = ETEs;
2961 register INT inside = 1;
2962 register INT isInside = 0;
2974 if ((!inside && !isInside) ||
2975 ( inside && isInside))
3012 pETEchase = pETEchase->
back;
3015 if (pETEchase != pETEinsert)
3017 pETEchaseBackTMP = pETEchase->
back;
3018 pETEinsert->
back->next = AET;
3022 pETEinsert->
next = pETEchase;
3023 pETEchase->
back->next = pETEinsert;
3024 pETEchase->
back = pETEinsert;
3025 pETEinsert->
back = pETEchaseBackTMP;
3048 tmpSLLBlock = pSLLBlock->
next;
3050 pSLLBlock = tmpSLLBlock;
3064 INT numFullPtBlocks,
3076 extents = &
reg->rdh.rcBound;
3078 numRects = ((numFullPtBlocks *
NUMPTSTOBUFFER) + iCurPtBlock) >> 1;
3095 if (
reg->Buffer != &
reg->rdh.rcBound)
3100 reg->rdh.nCount = numRects;
3101 CurPtBlock = FirstPtBlock;
3102 rects =
reg->Buffer - 1;
3106 for ( ; numFullPtBlocks >= 0; numFullPtBlocks--)
3110 if (numFullPtBlocks == 0)
3111 i = iCurPtBlock >> 1;
3118 if ((numRects &&
pts->
x == rects->
left) &&
3121 ((numRects == 1) || (rects[-1].
top != rects->
top)) &&
3141 CurPtBlock = CurPtBlock->
next;
3146 extents->
top =
reg->Buffer->top;
3157 reg->rdh.nCount = numRects;
3199 const POINT *PrevPt, *CurrPt, *EndPt;
3217 for (poly = 0; poly < nbpolygons; poly++)
3234 if (PrevPt->
y > CurrPt->
y)
3261 if (PrevPt->
y >
ET->ymax)
3262 ET->ymax = PrevPt->
y;
3263 if (PrevPt->
y <
ET->ymin)
3264 ET->ymin = PrevPt->
y;
3296 UINT numFullPtBlocks = 0;
3308 if (((cPolygons == 1) && ((pcPoints[0] == 4) ||
3309 ((pcPoints[0] == 5) && (ppt[4].
x == ppt[0].
x) && (ppt[4].
y == ppt[0].
y)))) &&
3310 (((ppt[0].
y == ppt[1].
y) &&
3311 (ppt[1].
x == ppt[2].
x) &&
3312 (ppt[2].
y == ppt[3].
y) &&
3313 (ppt[3].
x == ppt[0].
x)) ||
3314 ((ppt[0].
x == ppt[1].
x) &&
3315 (ppt[1].
y == ppt[2].
y) &&
3316 (ppt[2].
x == ppt[3].
x) &&
3317 (ppt[3].
y == ppt[0].
y))))
3320 min(ppt[0].
x, ppt[2].
x),
3321 min(ppt[0].
y, ppt[2].
y),
3322 max(ppt[0].
x, ppt[2].
x),
3323 max(ppt[0].
y, ppt[2].
y));
3327 for (poly =
total = 0; poly < cPolygons; poly++)
3328 total += pcPoints[poly];
3335 DPRINT1(
"Failed to allocate %lu edge entries\n",
total);
3341 pSLL =
ET.scanlines.next;
3342 curPtBlock = &FirstPtBlock;
3347 for (
y =
ET.ymin;
y <
ET.ymax;
y++)
3371 if (tmpPtBlock ==
NULL)
3373 DPRINT1(
"Can't alloc tmpPtBlock\n");
3377 curPtBlock->
next = tmpPtBlock;
3378 curPtBlock = tmpPtBlock;
3393 for (
y =
ET.ymin;
y <
ET.ymax;
y++)
3426 if (tmpPtBlock ==
NULL)
3431 curPtBlock->
next = tmpPtBlock;
3432 curPtBlock = tmpPtBlock;
3460 for (curPtBlock = FirstPtBlock.
next; numFullPtBlocks-- > 0;)
3462 tmpPtBlock = curPtBlock->
next;
3464 curPtBlock = tmpPtBlock;
3550 if ((hrgnDst ==
NULL) ||
3554 DPRINT1(
"NtGdiCombineRgn invalid parameters: %p, %p, %p, %d\n",
3566 DPRINT1(
"NtGdiCombineRgn failed to lock regions: %p, %p, %p, %d\n",
3573 if (aprgn[1] != aprgn[0])
3575 if ((aprgn[2] !=
NULL) && (aprgn[2] != aprgn[0]) && (aprgn[2] != aprgn[1]))
3584 if (aprgn[2] !=
NULL)
3674 if ((ellipse_width < 2) || (ellipse_height < 2))
3684 obj->rdh.rcBound.top =
top;
3687 rects =
obj->Buffer;
3691 a = ellipse_width - 1;
3692 b = ellipse_height - 1;
3700 y = ellipse_height / 2;
3705 while (
x <= ellipse_width / 2)
3721 for (
i = 0;
i < ellipse_height / 2;
i++)
3728 for (;
i < ellipse_height;
i++)
3733 rects[ellipse_height / 2].
top =
top + ellipse_height / 2;
3753 if ((hSrcRgn1 ==
NULL) || (hSrcRgn2 ==
NULL))
3759 if (hSrcRgn1 == hSrcRgn2)
3771 ahrgn[0] = hSrcRgn1;
3772 ahrgn[1] = hSrcRgn2;
3775 DPRINT1(
"NtGdiEqualRgn failed to lock regions: %p, %p\n",
3776 hSrcRgn1, hSrcRgn2);
3804 if ((tRect1 ==
NULL) || (tRect2 ==
NULL))
3811 (tRect1[
i].
top != tRect2[
i].
top) ||
3842 DPRINT(
"NtGdiExtCreateRegion\n");
3883 for(
i=0;
i<nCount;
i++)
3997 DPRINT1(
"NtGdiOffsetRgn: failed to lock region %p\n",
hrgn);
4030 DPRINT1(
"NtGdiPtInRegion: hrgn error\n");
4055 rcTemp = *prclUnsafe;
4059 DPRINT1(
"NtGdiRectInRegion: Exception accessing the rect\n");
4141 lpRgnData->rdh.nRgnSize = cjRects;
static VOID FASTCALL REGION_SetExtents(PREGION pReg)
static BOOL FASTCALL REGION_CopyRegion(PREGION dst, PREGION src)
#define ERROR_INVALID_PARAMETER
struct _RGNDATAHEADER RGNDATAHEADER
PGDIOBJ NTAPI GDIOBJ_LockObject(HGDIOBJ hobj, UCHAR objt)
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres)
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
static BOOL FASTCALL REGION_RegionOp(PREGION newReg, PREGION reg1, PREGION reg2, overlapProcp overlapFunc, nonOverlapProcp nonOverlap1Func, nonOverlapProcp nonOverlap2Func)
static BOOL FASTCALL REGION_IntersectO(PREGION pReg, PRECTL r1, PRECTL r1End, PRECTL r2, PRECTL r2End, INT top, INT bottom)
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
static VOID FASTCALL REGION_loadAET(EDGE_TABLE_ENTRY *AET, EDGE_TABLE_ENTRY *ETEs)
BOOL FASTCALL REGION_SetPolyPolygonRgn(_Inout_ PREGION prgn, _In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
FORCEINLINE VOID RECTL_vSetEmptyRect(_Out_ RECTL *prcl)
struct _POINTBLOCK POINTBLOCK
VOID NTAPI GdiPoolFree(PGDI_POOL pPool, PVOID pvAlloc)
INT FASTCALL REGION_SubtractRectFromRgn(PREGION prgnDest, PREGION prgnSrc, const RECTL *prcl)
#define STATUS_INVALID_PARAMETER
GLdouble GLdouble GLdouble r
static BOOL FASTCALL REGION_SubtractO(PREGION pReg, PRECTL r1, PRECTL r1End, PRECTL r2, PRECTL r2End, INT top, INT bottom)
GLuint GLuint GLsizei count
static BOOL FASTCALL REGION_UnionNonO(PREGION pReg, PRECTL r, PRECTL rEnd, INT top, INT bottom)
EDGE_TABLE_ENTRY * edgelist
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
_In_ HANDLE _In_ HANDLE hrgnSrc2
#define ERROR_INVALID_HANDLE
#define REGION_NOT_EMPTY(pReg)
static BOOL FASTCALL REGION_SubtractNonO1(PREGION pReg, PRECTL r, PRECTL rEnd, INT top, INT bottom)
#define ERROR_NOT_ENOUGH_MEMORY
GLint GLint GLint GLint GLint x
static BOOL REGION_bGrowBufferSize(_Inout_ PREGION prgn, _In_ UINT cRects)
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
ULONG NTAPI GreGetObjectOwner(HGDIOBJ hobj)
__kernel_entry BOOL APIENTRY NtGdiRectInRegion(_In_ HRGN hrgn, _Inout_ LPRECT prclUnsafe)
struct _SCANLINE_LIST * next
HRGN APIENTRY NtGdiCreateRectRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
HRGN APIENTRY NtGdiExtCreateRegion(OPTIONAL LPXFORM Xform, DWORD Count, LPRGNDATA RgnData)
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
static BOOL FASTCALL REGION_XorRegion(PREGION dr, PREGION sra, PREGION srb)
GLsizei GLsizei GLuint * obj
struct _POINTBLOCK * next
static __inline BOOL REGION_bMergeRect(_Inout_ PREGION prgn, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
static INT FASTCALL REGION_PtsToRegion(INT numFullPtBlocks, INT iCurPtBlock, POINTBLOCK *FirstPtBlock, PREGION reg)
struct _EDGE_TABLE_ENTRY * nextWETE
BOOL APIENTRY NtGdiEqualRgn(HRGN hSrcRgn1, HRGN hSrcRgn2)
static INT FASTCALL REGION_Coalesce(PREGION pReg, INT prevStart, INT curStart)
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
_Notnull_ PRGN_ATTR prgnattr
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
static __inline BOOL REGION_bAddRect(_Inout_ PREGION prgn, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
struct _SCANLINE_LIST SCANLINE_LIST
BOOL FASTCALL REGION_bCopy(PREGION dst, PREGION src)
_Out_opt_ int _Out_opt_ int * cy
BOOL FASTCALL REGION_RectInRegion(PREGION Rgn, const RECTL *rect)
BOOL(FASTCALL * overlapProcp)(PREGION, PRECT, PRECT, PRECT, PRECT, INT, INT)
PVOID NTAPI GdiPoolAllocate(PGDI_POOL pPool)
BOOL FASTCALL IntRectInRegion(HRGN hRgn, LPRECTL rc)
BOOL NTAPI GDIOBJ_bLockMultipleObjects(IN ULONG ulCount, IN HGDIOBJ *ahObj, OUT PGDIOBJ *apObj, IN UCHAR objt)
static BOOL REGION_bMakeFrameRegion(_Inout_ PREGION prgnDest, _Inout_ PREGION prgnSrc, _In_ INT cx, _In_ INT cy)
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
#define GDI_HANDLE_GET_TYPE(h)
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
POINT pts[NUMPTSTOBUFFER]
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL * prclSrc
static __inline BOOL REGION_bEnsureBufferSize(_Inout_ PREGION prgn, _In_ UINT cRects)
GLboolean GLboolean GLboolean b
INT APIENTRY NtGdiGetRgnBox(HRGN hRgn, PRECTL pRect)
#define EXTENTCHECK(r1, r2)
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
HRGN FASTCALL GreCreateFrameRgn(HRGN hrgn, INT cx, INT cy)
BOOL FASTCALL REGION_UnionRectWithRgn(PREGION rgn, const RECTL *rect)
#define NT_SUCCESS(StatCode)
static BOOL FASTCALL REGION_UnionRegion(PREGION newReg, PREGION reg1, PREGION reg2)
#define EXCEPTION_EXECUTE_HANDLER
BOOL FASTCALL IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask)
BOOL FASTCALL RECTL_bUnionRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
BOOL FASTCALL REGION_bXformRgn(_Inout_ PREGION prgn, _In_ PMATRIX pmx)
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)
INT APIENTRY IntGdiGetRgnBox(HRGN hRgn, PRECTL pRect)
#define COPY_RECTS(dest, src, nRects)
struct _SCANLINE_LISTBLOCK * next
HRGN APIENTRY NtGdiCreateRoundRectRgn(INT left, INT top, INT right, INT bottom, INT ellipse_width, INT ellipse_height)
static VOID FASTCALL REGION_computeWAET(EDGE_TABLE_ENTRY *AET)
static BOOL FASTCALL REGION_SubtractRegion(PREGION regD, PREGION regM, PREGION regS)
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
#define __WARNING_MAYBE_UNINIT_VAR
#define ExAllocatePoolWithTag(hernya, size, tag)
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
static BOOL REGION_bMakeSimpleFrameRgn(_Inout_ PREGION prgn, _In_ PRECTL prclSrc, _In_ INT cx, _In_ INT cy)
SCANLINE_LIST SLLs[SLLSPERBLOCK]
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
static BOOL FASTCALL REGION_InsertionSort(EDGE_TABLE_ENTRY *AET)
FORCEINLINE VOID REGION_vAddRect(_Inout_ PREGION prgn, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
VOID NTAPI REGION_vCleanup(PVOID ObjectBody)
BOOL APIENTRY NtGdiSetRectRgn(_In_ HRGN hrgn, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
struct _EDGE_TABLE_ENTRY EDGE_TABLE_ENTRY
#define GDI_OBJ_HMGR_POWNED
static const WCHAR Cleanup[]
#define _Out_writes_bytes_to_opt_(size, count)
VOID FASTCALL SetLastNtError(NTSTATUS Status)
struct _EDGE_TABLE_ENTRY * back
struct _GDI_POOL * pPoolRgnAttr
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
static LPHIST_ENTRY Bottom
#define EMPTY_REGION(pReg)
BOOL NTAPI REGION_bAllocRgnAttr(PREGION prgn)
static VOID FASTCALL REGION_FreeStorage(SCANLINE_LISTBLOCK *pSLLBlock)
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
INT APIENTRY NtGdiCombineRgn(IN HRGN hrgnDst, IN HRGN hrgnSrc1, IN HRGN hrgnSrc2, IN INT iMode)
INT APIENTRY NtGdiOffsetRgn(_In_ HRGN hrgn, _In_ INT cx, _In_ INT cy)
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
PREGION FASTCALL REGION_AllocRgnWithHandle(INT nReg)
GLint GLint GLint GLint GLint GLint y
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
BOOL FASTCALL REGION_bIntersectRegion(PREGION newReg, PREGION reg1, PREGION reg2)
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET)
struct _EDGE_TABLE_ENTRY * next
struct _SCANLINE_LISTBLOCK SCANLINE_LISTBLOCK
static BOOL FASTCALL REGION_UnionO(PREGION pReg, PRECTL r1, PRECTL r1End, PRECTL r2, PRECTL r2End, INT top, INT bottom)
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
HRGN NTAPI GreCreatePolyPolygonRgn(_In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
#define RtlCopyMemory(Destination, Source, Length)
INT FASTCALL REGION_CropRegion(PREGION rgnDst, PREGION rgnSrc, const RECTL *rect)
#define _SEH2_EXCEPT(...)
INT FASTCALL REGION_Complexity(PREGION prgn)
GLdouble GLdouble GLdouble GLdouble top
static BOOL FASTCALL REGION_IntersectRegion(PREGION newReg, PREGION reg1, PREGION reg2)
#define _SEH2_GetExceptionCode()
static VOID FASTCALL REGION_InsertEdgeInET(EDGE_TABLE *ET, EDGE_TABLE_ENTRY *ETE, INT scanline, SCANLINE_LISTBLOCK **SLLBlock, INT *iSLLBlock)
GLboolean GLboolean GLboolean GLboolean a
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
VOID FASTCALL REGION_SetRectRgn(PREGION rgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
PREGION FASTCALL REGION_AllocUserRgnWithHandle(INT nRgn)
#define ExFreePoolWithTag(_P, _T)
VOID FASTCALL REGION_Delete(PREGION pRgn)
static VOID REGION_vSyncRegion(_In_ PREGION prgn)
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
POBJ NTAPI GDIOBJ_AllocateObject(UCHAR objt, ULONG cjSize, FLONG fl)
VOID NTAPI GDIOBJ_vFreeObject(POBJ pobj)
#define _PRAGMA_WARNING_SUPPRESS(x)
BOOL FASTCALL REGION_PtInRegion(PREGION prgn, INT X, INT Y)
HRGN APIENTRY NtGdiCreateEllipticRgn(INT Left, INT Top, INT Right, INT Bottom)
BOOL(FASTCALL * nonOverlapProcp)(PREGION, PRECT, PRECT, INT, INT)
HGDIOBJ NTAPI GDIOBJ_hInsertObject(POBJ pobj, ULONG ulOwner)
PULONG MinorVersion OPTIONAL
BOOL APIENTRY NtGdiPtInRegion(_In_ HRGN hrgn, _In_ INT x, _In_ INT y)