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))) 34 if (!Points ||
Count < 2 )
50 pdcattr =
dc->pdcattr;
54 for (CurrentPoint = 0; CurrentPoint <
Count; CurrentPoint++)
56 Points[CurrentPoint].
x +=
dc->ptlDCOrig.x;
57 Points[CurrentPoint].
y +=
dc->ptlDCOrig.y;
61 DestRect.
left = Points[0].
x;
62 DestRect.
right = Points[0].
x;
63 DestRect.
top = Points[0].
y;
66 for (CurrentPoint = 1; CurrentPoint <
Count; ++CurrentPoint)
68 DestRect.
left =
min(DestRect.
left, Points[CurrentPoint].
x);
70 DestRect.
top =
min(DestRect.
top, Points[CurrentPoint].
y);
81 pbrFill =
dc->dclevel.pbrFill;
82 pbrLine =
dc->dclevel.pbrLine;
83 psurf =
dc->dclevel.pSurface;
93 BrushOrigin = *((
PPOINTL)&pbrFill->ptOrigin);
94 BrushOrigin.
x +=
dc->ptlDCOrig.x;
95 BrushOrigin.
y +=
dc->ptlDCOrig.y;
98 &
dc->eboFill.BrushObject,
119 &
dc->eboLine.BrushObject,
133 &
dc->eboLine.BrushObject,
160 Points+=*PolyCounts++;
212 LONG PenWidth, PenOrigWidth;
213 LONG RadiusX, RadiusY, CenterX, CenterY;
215 BRUSH tmpFillBrushObj;
242 INT tmp = Right; Right = Left; Left = tmp;
250 pdcattr =
dc->pdcattr;
267 PenOrigWidth = PenWidth = pbrush->lWidth;
268 if (pbrush->ulPenStyle ==
PS_NULL) PenWidth = 0;
272 if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
274 Left += PenWidth / 2;
275 Right -= (PenWidth - 1) / 2;
277 Bottom -= (PenWidth - 1) / 2;
280 if (!PenWidth) PenWidth = 1;
281 pbrush->lWidth = PenWidth;
283 RectBounds.
left = Left;
284 RectBounds.
right = Right;
290 RectBounds.left +=
dc->ptlDCOrig.x;
291 RectBounds.right +=
dc->ptlDCOrig.x;
292 RectBounds.top +=
dc->ptlDCOrig.y;
293 RectBounds.bottom +=
dc->ptlDCOrig.y;
296 RadiusX =
max((RectBounds.right - RectBounds.left) / 2, 2);
297 RadiusY =
max((RectBounds.bottom - RectBounds.top) / 2, 2);
298 CenterX = (RectBounds.right + RectBounds.left) / 2;
299 CenterY = (RectBounds.bottom + RectBounds.top) / 2;
301 DPRINT(
"Ellipse 1: Left: %d, Top: %d, Right: %d, Bottom: %d\n",
302 RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom);
304 DPRINT(
"Ellipse 2: XLeft: %d, YLeft: %d, Width: %d, Height: %d\n",
305 CenterX - RadiusX, CenterY + RadiusY, RadiusX*2, RadiusY*2);
308 if (
NULL == pFillBrushObj)
316 RtlCopyMemory(&tmpFillBrushObj, pFillBrushObj,
sizeof(tmpFillBrushObj));
345 pbrush->lWidth = PenOrigWidth;
348 DPRINT(
"Ellipse Exit.\n");
388 ULONG nPoints = 0, nMaxPoints = 0, nInvalid = 0,
i;
390 if (!UnsafePoints || !UnsafeCounts ||
405 if (UnsafeCounts[
i] < 2)
409 nPoints += UnsafeCounts[
i];
410 nMaxPoints =
max(nMaxPoints, UnsafeCounts[
i]);
425 if (nPoints == 0 || nPoints < nMaxPoints)
548 pdcattr =
dc->pdcattr;
557 DestRect.
left =
min(LeftRect, RightRect);
558 DestRect.
right =
max(LeftRect, RightRect);
559 DestRect.
top =
min(TopRect, BottomRect);
560 DestRect.
bottom =
max(TopRect, BottomRect);
564 DestRect.left +=
dc->ptlDCOrig.x;
565 DestRect.right +=
dc->ptlDCOrig.x;
566 DestRect.top +=
dc->ptlDCOrig.y;
567 DestRect.bottom +=
dc->ptlDCOrig.y;
589 pbrFill =
dc->dclevel.pbrFill;
590 pbrLine =
dc->dclevel.pbrLine;
597 psurf =
dc->dclevel.pSurface;
608 BrushOrigin = *((
PPOINTL)&pbrFill->ptOrigin);
609 BrushOrigin.
x +=
dc->ptlDCOrig.x;
610 BrushOrigin.
y +=
dc->ptlDCOrig.y;
619 &
dc->eboFill.BrushObject,
634 &
dc->eboLine.BrushObject,
635 DestRect.left, DestRect.top, DestRect.right, DestRect.top,
641 &
dc->eboLine.BrushObject,
642 DestRect.right, DestRect.top, DestRect.right, DestRect.bottom,
648 &
dc->eboLine.BrushObject,
649 DestRect.right, DestRect.bottom, DestRect.left, DestRect.bottom,
655 &
dc->eboLine.BrushObject,
656 DestRect.left, DestRect.bottom, DestRect.left, DestRect.top,
692 ULONG PolyCounts = 4;
694 DestCoords[0].
x = DestCoords[3].
x = LeftRect;
695 DestCoords[0].
y = DestCoords[1].
y = TopRect;
696 DestCoords[1].
x = DestCoords[2].
x = RightRect;
697 DestCoords[2].
y = DestCoords[3].
y = BottomRect;
726 LONG PenWidth, PenOrigWidth;
734 xCurveDiameter, yCurveDiameter );
738 xCurveDiameter =
max(
abs( xCurveDiameter ), 1);
739 yCurveDiameter =
max(
abs( yCurveDiameter ), 1);
743 INT tmp = Right; Right = Left; Left = tmp;
750 pdcattr =
dc->pdcattr;
766 PenOrigWidth = PenWidth = pbrLine->lWidth;
767 if (pbrLine->ulPenStyle ==
PS_NULL) PenWidth = 0;
771 if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
773 Left += PenWidth / 2;
774 Right -= (PenWidth - 1) / 2;
776 Bottom -= (PenWidth - 1) / 2;
779 if (!PenWidth) PenWidth = 1;
780 pbrLine->lWidth = PenWidth;
782 RectBounds.
left = Left;
784 RectBounds.
right = Right;
789 RectBounds.left +=
dc->ptlDCOrig.x;
790 RectBounds.top +=
dc->ptlDCOrig.y;
791 RectBounds.right +=
dc->ptlDCOrig.x;
792 RectBounds.bottom +=
dc->ptlDCOrig.y;
807 brushTemp.
ptOrigin.
x += RectBounds.left - Left;
835 pbrLine->lWidth = PenOrigWidth;
854 DPRINT(
"NtGdiRoundRect(0x%p,%i,%i,%i,%i,%i,%i)\n",
hDC,LeftRect,TopRect,RightRect,BottomRect,Width,Height);
857 DPRINT1(
"NtGdiRoundRect() - hDC is invalid\n");
862 ret =
IntRoundRect (
dc, LeftRect, TopRect, RightRect, BottomRect, Width, Height );
888 if (
ulMode & GRADIENT_FILL_TRIANGLE)
892 for (
i = 0;
i <
nMesh;
i++, pTriangle++)
906 for (
i = 0;
i <
nMesh;
i++, pRect++)
924 if (!pdc->dclevel.pSurface)
943 rclExtent.left += pdc->ptlDCOrig.x;
944 rclExtent.right += pdc->ptlDCOrig.x;
945 rclExtent.top += pdc->ptlDCOrig.y;
946 rclExtent.bottom += pdc->ptlDCOrig.y;
954 ptlDitherOrg.
x = ptlDitherOrg.
y = 0;
957 ptlDitherOrg.
x += pdc->ptlDCOrig.x;
958 ptlDitherOrg.
y += pdc->ptlDCOrig.y;
967 psurf = pdc->dclevel.pSurface;
1002 ULONG cbVertex, cbMesh;
1013 case GRADIENT_FILL_RECT_H:
1014 case GRADIENT_FILL_RECT_V:
1017 case GRADIENT_FILL_TRIANGLE:
1026 if(cbVertex + cbMesh <= cbVertex)
1093 if (!
dc->dclevel.pSurface)
1100 pdcattr =
dc->pdcattr;
1109 psurf =
dc->dclevel.pSurface;
1111 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
#define BRUSH_ShareLockBrush(hBrush)
struct _TRIVERTEX TRIVERTEX
#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)
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)
BOOL FASTCALL PATH_Ellipse(PDC dc, INT x1, INT y1, INT x2, INT y2)
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
#define EXCEPTION_EXECUTE_HANDLER
BOOL FASTCALL IntGdiPolyPolygon(DC *dc, LPPOINT Points, PULONG PolyCounts, int Count)
BOOL FASTCALL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
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)
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 _SEH2_YIELD(STMT_)
#define NT_SUCCESS(StatCode)
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)
void IntEngLineTo(SURFOBJ *, CLIPOBJ, PBRUSHOBJ, int x1, int y1, int x2, int y2, RECTL *, MIX mix)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IntLPtoDP(pdc, ppt, count)
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)
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)
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
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 ExFreePoolWithTag(_P, _T)
#define _SEH2_GetExceptionCode()
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
PBRUSH FASTCALL PEN_ShareLockPen(HPEN hobj)
#define ROP4_FROM_INDEX(index)
BOOL FASTCALL IntGdiPolyBezier(DC *dc, LPPOINT pt, DWORD Count)
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)
BOOL FASTCALL REGION_PtInRegion(PREGION prgn, INT X, INT Y)