14#define Rsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0)))
15#define Rcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
35 if (!Points ||
Count < 2 )
51 pdcattr =
dc->pdcattr;
55 for (CurrentPoint = 0; CurrentPoint <
Count; CurrentPoint++)
57 Points[CurrentPoint].
x +=
dc->ptlDCOrig.x;
58 Points[CurrentPoint].
y +=
dc->ptlDCOrig.y;
62 DestRect.
left = Points[0].
x;
63 DestRect.
right = Points[0].
x;
64 DestRect.
top = Points[0].
y;
67 for (CurrentPoint = 1; CurrentPoint <
Count; ++CurrentPoint)
69 DestRect.
left =
min(DestRect.
left, Points[CurrentPoint].
x);
71 DestRect.
top =
min(DestRect.
top, Points[CurrentPoint].
y);
82 pbrFill =
dc->dclevel.pbrFill;
83 pbrLine =
dc->dclevel.pbrLine;
84 psurf =
dc->dclevel.pSurface;
94 BrushOrigin = *((
PPOINTL)&pbrFill->ptOrigin);
95 BrushOrigin.
x +=
dc->ptlDCOrig.x;
96 BrushOrigin.
y +=
dc->ptlDCOrig.y;
99 &
dc->eboFill.BrushObject,
119 pPath->
pos = Points[0];
131 dc->dclevel.flPath &= ~DCPATH_ACTIVE;
151 &
dc->eboLine.BrushObject,
165 &
dc->eboLine.BrushObject,
193 Points+=*PolyCounts++;
245 LONG PenWidth, PenOrigWidth;
246 LONG RadiusX, RadiusY, CenterX, CenterY;
248 BRUSH tmpFillBrushObj;
275 INT tmp = Right; Right = Left; Left = tmp;
283 pdcattr =
dc->pdcattr;
300 PenOrigWidth = PenWidth = pbrush->lWidth;
301 if (pbrush->ulPenStyle ==
PS_NULL) PenWidth = 0;
305 if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
307 Left += PenWidth / 2;
308 Right -= (PenWidth - 1) / 2;
310 Bottom -= (PenWidth - 1) / 2;
313 if (!PenWidth) PenWidth = 1;
314 pbrush->lWidth = PenWidth;
316 RectBounds.
left = Left;
317 RectBounds.
right = Right;
323 RectBounds.
left +=
dc->ptlDCOrig.x;
324 RectBounds.
right +=
dc->ptlDCOrig.x;
325 RectBounds.
top +=
dc->ptlDCOrig.y;
326 RectBounds.
bottom +=
dc->ptlDCOrig.y;
329 RadiusX =
max((RectBounds.
right - RectBounds.
left) / 2, 2);
330 RadiusY =
max((RectBounds.
bottom - RectBounds.
top) / 2, 2);
331 CenterX = (RectBounds.
right + RectBounds.
left) / 2;
332 CenterY = (RectBounds.
bottom + RectBounds.
top) / 2;
334 DPRINT(
"Ellipse 1: Left: %d, Top: %d, Right: %d, Bottom: %d\n",
337 DPRINT(
"Ellipse 2: XLeft: %d, YLeft: %d, Width: %d, Height: %d\n",
338 CenterX - RadiusX, CenterY + RadiusY, RadiusX*2, RadiusY*2);
341 if (
NULL == pFillBrushObj)
349 RtlCopyMemory(&tmpFillBrushObj, pFillBrushObj,
sizeof(tmpFillBrushObj));
378 pbrush->lWidth = PenOrigWidth;
381 DPRINT(
"Ellipse Exit.\n");
421 ULONG nPoints = 0, nMaxPoints = 0, nInvalid = 0,
i;
423 if (!UnsafePoints || !UnsafeCounts ||
438 if (UnsafeCounts[
i] < 2)
442 nPoints += UnsafeCounts[
i];
443 nMaxPoints =
max(nMaxPoints, UnsafeCounts[
i]);
458 if (nPoints == 0 || nPoints < nMaxPoints)
582 pdcattr =
dc->pdcattr;
591 DestRect.
left =
min(LeftRect, RightRect);
592 DestRect.
right =
max(LeftRect, RightRect);
593 DestRect.
top =
min(TopRect, BottomRect);
594 DestRect.
bottom =
max(TopRect, BottomRect);
598 DestRect.
left +=
dc->ptlDCOrig.x;
599 DestRect.
right +=
dc->ptlDCOrig.x;
600 DestRect.
top +=
dc->ptlDCOrig.y;
623 pbrFill =
dc->dclevel.pbrFill;
624 pbrLine =
dc->dclevel.pbrLine;
631 psurf =
dc->dclevel.pSurface;
642 BrushOrigin = *((
PPOINTL)&pbrFill->ptOrigin);
643 BrushOrigin.
x +=
dc->ptlDCOrig.x;
644 BrushOrigin.
y +=
dc->ptlDCOrig.y;
653 &
dc->eboFill.BrushObject,
675 pPath->
pos.
x = LeftRect;
676 pPath->
pos.
y = TopRect;
687 dc->dclevel.flPath &= ~DCPATH_ACTIVE;
702 &
dc->eboLine.BrushObject,
709 &
dc->eboLine.BrushObject,
716 &
dc->eboLine.BrushObject,
723 &
dc->eboLine.BrushObject,
761 ULONG PolyCounts = 4;
763 DestCoords[0].
x = DestCoords[3].
x = LeftRect;
764 DestCoords[0].
y = DestCoords[1].
y = TopRect;
765 DestCoords[1].
x = DestCoords[2].
x = RightRect;
766 DestCoords[2].
y = DestCoords[3].
y = BottomRect;
795 LONG PenWidth, PenOrigWidth;
803 xCurveDiameter, yCurveDiameter );
807 xCurveDiameter =
max(
abs( xCurveDiameter ), 1);
808 yCurveDiameter =
max(
abs( yCurveDiameter ), 1);
812 INT tmp = Right; Right = Left; Left = tmp;
819 pdcattr =
dc->pdcattr;
835 PenOrigWidth = PenWidth = pbrLine->lWidth;
836 if (pbrLine->ulPenStyle ==
PS_NULL) PenWidth = 0;
840 if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
842 Left += PenWidth / 2;
843 Right -= (PenWidth - 1) / 2;
845 Bottom -= (PenWidth - 1) / 2;
848 if (!PenWidth) PenWidth = 1;
849 pbrLine->lWidth = PenWidth;
851 RectBounds.
left = Left;
853 RectBounds.
right = Right;
858 RectBounds.
left +=
dc->ptlDCOrig.x;
859 RectBounds.
top +=
dc->ptlDCOrig.y;
860 RectBounds.
right +=
dc->ptlDCOrig.x;
861 RectBounds.
bottom +=
dc->ptlDCOrig.y;
904 pbrLine->lWidth = PenOrigWidth;
923 DPRINT(
"NtGdiRoundRect(0x%p,%i,%i,%i,%i,%i,%i)\n",
hDC,LeftRect,TopRect,RightRect,BottomRect,
Width,
Height);
926 DPRINT1(
"NtGdiRoundRect() - hDC is invalid\n");
957 if (
ulMode & GRADIENT_FILL_TRIANGLE)
961 for (
i = 0;
i <
nMesh;
i++, pTriangle++)
975 for (
i = 0;
i <
nMesh;
i++, pRect++)
993 if (!pdc->dclevel.pSurface)
1012 rclExtent.
left += pdc->ptlDCOrig.x;
1013 rclExtent.
right += pdc->ptlDCOrig.x;
1014 rclExtent.
top += pdc->ptlDCOrig.y;
1015 rclExtent.
bottom += pdc->ptlDCOrig.y;
1023 ptlDitherOrg.
x = ptlDitherOrg.
y = 0;
1026 ptlDitherOrg.
x += pdc->ptlDCOrig.x;
1027 ptlDitherOrg.
y += pdc->ptlDCOrig.y;
1036 psurf = pdc->dclevel.pSurface;
1071 ULONG cbVertex, cbMesh;
1082 case GRADIENT_FILL_RECT_H:
1083 case GRADIENT_FILL_RECT_V:
1086 case GRADIENT_FILL_TRIANGLE:
1095 if(cbVertex + cbMesh <= cbVertex)
1162 if (!
dc->dclevel.pSurface)
1169 pdcattr =
dc->pdcattr;
1178 psurf =
dc->dclevel.pSurface;
1180 prgn =
dc->prgnRao ?
dc->prgnRao :
dc->prgnVis;
static LPHIST_ENTRY Bottom
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
VOID FASTCALL DC_vUpdateLineBrush(PDC pdc)
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
FORCEINLINE PDC DC_LockDc(HDC hdc)
#define ERROR_NOT_ENOUGH_MEMORY
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define ERROR_INVALID_HANDLE
static void cleanup(void)
BOOL FASTCALL IntFillEllipse(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
BOOL FASTCALL IntDrawRoundRect(PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrushPen)
BOOL FASTCALL IntDrawEllipse(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
BOOL FASTCALL IntFillRoundRect(PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrush)
#define ExAllocatePoolWithTag(hernya, size, tag)
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
BOOL APIENTRY NtGdiRoundRect(HDC hDC, int LeftRect, int TopRect, int RightRect, int BottomRect, int Width, int Height)
ULONG_PTR APIENTRY NtGdiPolyPolyDraw(IN HDC hDC, IN PPOINT UnsafePoints, IN PULONG UnsafeCounts, IN ULONG Count, IN INT iFunc)
BOOL APIENTRY NtGdiRectangle(HDC hDC, int LeftRect, int TopRect, int RightRect, int BottomRect)
BOOL APIENTRY NtGdiExtFloodFill(HDC hDC, INT XStart, INT YStart, COLORREF Color, UINT FillType)
BOOL FASTCALL IntRectangle(PDC dc, int LeftRect, int TopRect, int RightRect, int BottomRect)
BOOL FASTCALL IntRoundRect(PDC dc, int Left, int Top, int Right, int Bottom, int xCurveDiameter, int yCurveDiameter)
BOOL FASTCALL IntPolygon(HDC hdc, POINT *Point, int Count)
BOOL NTAPI GreGradientFill(HDC hdc, PTRIVERTEX pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, ULONG ulMode)
BOOL APIENTRY NtGdiEllipse(HDC hDC, int Left, int Top, int Right, int Bottom)
BOOL FASTCALL IntGdiPolyPolygon(DC *dc, LPPOINT Points, PULONG PolyCounts, int Count)
BOOL APIENTRY NtGdiGradientFill(HDC hdc, PTRIVERTEX pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, ULONG ulMode)
BOOL FASTCALL IntGdiPolygon(PDC dc, PPOINT Points, int Count)
#define BRUSH_ShareLockBrush(hBrush)
#define BRUSH_ShareUnlockBrush(pBrush)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
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
#define EXCEPTION_EXECUTE_HANDLER
#define ROP4_FROM_INDEX(index)
#define ROP2_TO_MIX(Rop2)
BOOL FASTCALL IntGdiPolyBezier(DC *dc, LPPOINT pt, DWORD Count)
BOOL FASTCALL IntGdiPolylineTo(DC *dc, LPPOINT pt, DWORD Count)
BOOL FASTCALL IntGdiPolyPolyline(DC *dc, LPPOINT pt, PULONG PolyPoints, DWORD Count)
BOOL FASTCALL IntGdiPolyBezierTo(DC *dc, LPPOINT pt, DWORD Count)
#define ExFreePoolWithTag(_P, _T)
unsigned __int3264 UINT_PTR
BOOL FASTCALL IntFillPolygon(PDC dc, SURFACE *psurf, BRUSHOBJ *BrushObj, CONST PPOINT Points, int Count, RECTL DestRect, POINTL *BrushOrigin)
#define PATH_UnlockPath(pPath)
#define PATH_IsPathOpen(dclevel)
#define PEN_ShareUnlockPen(ppen)
#define IntIsEffectiveWidePen(pbrLine)
void IntEngLineTo(SURFOBJ *, CLIPOBJ, PBRUSHOBJ, int x1, int y1, int x2, int y2, RECTL *, MIX mix)
BOOL FillPolygon(PDC dc, SURFOBJ *SurfObj, PBRUSHOBJ BrushObj, MIX RopMode, CONST PPOINT Points, int Count, RECTL BoundRect)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
struct _PALETTE *const ppal
#define RtlCopyMemory(Destination, Source, Length)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
BOOLEAN DIB_XXBPP_FloodFillSolid(SURFOBJ *, BRUSHOBJ *, RECTL *, POINTL *, ULONG, UINT)
BOOL APIENTRY IntEngBitBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush, ROP4 Rop4)
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
BOOL APIENTRY IntEngGradientFill(IN SURFOBJ *psoDest, IN CLIPOBJ *pco, IN XLATEOBJ *pxlo, IN TRIVERTEX *pVertex, IN ULONG nVertex, IN PVOID pMesh, IN ULONG nMesh, IN RECTL *prclExtents, IN POINTL *pptlDitherOrg, IN ULONG ulMode)
BOOL FASTCALL PATH_PolyPolygon(PDC dc, const POINT *pts, const INT *counts, UINT polygons)
BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
BOOL FASTCALL PATH_Rectangle(PDC dc, INT x1, INT y1, INT x2, INT y2)
BOOL FASTCALL PATH_Delete(HPATH hPath)
BOOL PATH_Ellipse(PDC dc, INT x1, INT y1, INT x2, INT y2)
BOOL FASTCALL PATH_LineTo(PDC dc, INT x, INT y)
BOOL FASTCALL PATH_StrokePath(DC *dc, PPATH pPath)
PPATH FASTCALL PATH_CreatePath(int count)
BOOL FASTCALL PATH_MoveTo(PDC dc, PPATH pPath)
PBRUSH FASTCALL PEN_ShareLockPen(HPEN hobj)
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
BOOL FASTCALL REGION_PtInRegion(PREGION prgn, INT X, INT Y)
HRGN NTAPI GreCreatePolyPolygonRgn(_In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID pMesh
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG nVertex
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX * pVertex
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG nMesh
#define ERROR_INTERNAL_ERROR
struct _GRADIENT_TRIANGLE GRADIENT_TRIANGLE
struct _GRADIENT_RECT * PGRADIENT_RECT
struct _TRIVERTEX TRIVERTEX
struct _GRADIENT_TRIANGLE * PGRADIENT_TRIANGLE
struct _GRADIENT_RECT GRADIENT_RECT
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)