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];
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",
335 RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom);
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;
601 DestRect.bottom +=
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;
702 &
dc->eboLine.BrushObject,
703 DestRect.left, DestRect.top, DestRect.right, DestRect.top,
709 &
dc->eboLine.BrushObject,
710 DestRect.right, DestRect.top, DestRect.right, DestRect.bottom,
716 &
dc->eboLine.BrushObject,
717 DestRect.right, DestRect.bottom, DestRect.left, DestRect.bottom,
723 &
dc->eboLine.BrushObject,
724 DestRect.left, DestRect.bottom, DestRect.left, DestRect.top,
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;
876 brushTemp.
ptOrigin.
x += RectBounds.left - Left;
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;
#define BRUSH_ShareUnlockBrush(pBrush)
#define ROP2_TO_MIX(Rop2)
#define ERROR_INVALID_PARAMETER
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG nMesh
struct _GRADIENT_TRIANGLE GRADIENT_TRIANGLE
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID pMesh
BOOL APIENTRY NtGdiExtFloodFill(HDC hDC, INT XStart, INT YStart, COLORREF Color, UINT FillType)
BOOL FASTCALL PATH_Rectangle(PDC dc, INT x1, INT y1, INT x2, INT y2)
BOOL FASTCALL IntGdiPolylineTo(DC *dc, LPPOINT pt, DWORD Count)
VOID FASTCALL DC_vUpdateLineBrush(PDC pdc)
FORCEINLINE PDC DC_LockDc(HDC hdc)
#define ERROR_INTERNAL_ERROR
BOOL FASTCALL PATH_StrokePath(DC *dc, PPATH pPath)
#define BRUSH_ShareLockBrush(hBrush)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
PPATH FASTCALL PATH_CreatePath(int count)
struct _TRIVERTEX TRIVERTEX
BOOL FASTCALL PATH_MoveTo(PDC dc, PPATH pPath)
#define ERROR_INVALID_HANDLE
struct _PALETTE *const ppal
BOOL FASTCALL IntDrawRoundRect(PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrushPen)
#define ERROR_NOT_ENOUGH_MEMORY
BOOL FASTCALL IntDrawEllipse(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
GLint GLint GLint GLint GLint x
_In_ HFONT _Out_ PUINT Height
BOOL PATH_Ellipse(PDC dc, INT x1, INT y1, INT x2, INT y2)
BOOL FillPolygon(PDC dc, SURFOBJ *SurfObj, PBRUSHOBJ BrushObj, MIX RopMode, CONST PPOINT Points, int Count, RECTL BoundRect)
BOOL FASTCALL PATH_PolyPolygon(PDC dc, const POINT *pts, const INT *counts, UINT polygons)
ULONG_PTR APIENTRY NtGdiPolyPolyDraw(IN HDC hDC, IN PPOINT UnsafePoints, IN PULONG UnsafeCounts, IN ULONG Count, IN INT iFunc)
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
BOOL FASTCALL IntFillPolygon(PDC dc, SURFACE *psurf, BRUSHOBJ *BrushObj, CONST PPOINT Points, int Count, RECTL DestRect, POINTL *BrushOrigin)
struct _GRADIENT_RECT * PGRADIENT_RECT
BOOL FASTCALL IntGdiPolyPolygon(DC *dc, LPPOINT Points, PULONG PolyCounts, int Count)
BOOL FASTCALL IntGdiPolygon(PDC dc, PPOINT Points, int Count)
BOOL NTAPI GreGradientFill(HDC hdc, PTRIVERTEX pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, ULONG ulMode)
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)
#define PATH_UnlockPath(pPath)
BOOL FASTCALL IntGdiPolyPolyline(DC *dc, LPPOINT pt, PULONG PolyPoints, DWORD Count)
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
BOOL APIENTRY NtGdiGradientFill(HDC hdc, PTRIVERTEX pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, ULONG ulMode)
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX * pVertex
#define PATH_IsPathOpen(dclevel)
#define NT_SUCCESS(StatCode)
#define EXCEPTION_EXECUTE_HANDLER
BOOL FASTCALL IntGdiPolyBezierTo(DC *dc, LPPOINT pt, DWORD Count)
BOOL FASTCALL IntRectangle(PDC dc, int LeftRect, int TopRect, int RightRect, int BottomRect)
unsigned __int3264 UINT_PTR
BOOL APIENTRY NtGdiRectangle(HDC hDC, int LeftRect, int TopRect, int RightRect, int BottomRect)
BOOL FASTCALL PATH_LineTo(PDC dc, INT x, INT y)
void IntEngLineTo(SURFOBJ *, CLIPOBJ, PBRUSHOBJ, int x1, int y1, int x2, int y2, RECTL *, MIX mix)
#define ExAllocatePoolWithTag(hernya, size, tag)
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
BOOL FASTCALL IntPolygon(HDC hdc, POINT *Point, int Count)
#define PEN_ShareUnlockPen(ppen)
VOID FASTCALL SetLastNtError(NTSTATUS Status)
BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
BOOL APIENTRY NtGdiRoundRect(HDC hDC, int LeftRect, int TopRect, int RightRect, int BottomRect, int Width, int Height)
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
BOOL FASTCALL IntFillEllipse(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
static LPHIST_ENTRY Bottom
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
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
#define IntIsEffectiveWidePen(pbrLine)
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
GLint GLint GLint GLint GLint GLint y
BOOL APIENTRY NtGdiEllipse(HDC hDC, int Left, int Top, int Right, int Bottom)
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
BOOL FASTCALL IntFillRoundRect(PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrush)
BOOL FASTCALL IntRoundRect(PDC dc, int Left, int Top, int Right, int Bottom, int xCurveDiameter, int yCurveDiameter)
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
HRGN NTAPI GreCreatePolyPolygonRgn(_In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
char * cleanup(char *str)
#define RtlCopyMemory(Destination, Source, Length)
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG nVertex
#define _SEH2_EXCEPT(...)
BOOLEAN DIB_XXBPP_FloodFillSolid(SURFOBJ *, BRUSHOBJ *, RECTL *, POINTL *, ULONG, UINT)
struct _GRADIENT_RECT GRADIENT_RECT
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
#define _SEH2_GetExceptionCode()
#define _SEH2_YIELD(__stmt)
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
PBRUSH FASTCALL PEN_ShareLockPen(HPEN hobj)
#define ExFreePoolWithTag(_P, _T)
#define ROP4_FROM_INDEX(index)
BOOL FASTCALL IntGdiPolyBezier(DC *dc, LPPOINT pt, DWORD Count)
BOOL FASTCALL PATH_Delete(HPATH hPath)
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
struct _GRADIENT_TRIANGLE * PGRADIENT_TRIANGLE
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 DC_vUpdateFillBrush(PDC pdc)
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
BOOL FASTCALL REGION_PtInRegion(PREGION prgn, INT X, INT Y)