2010-02-26 11:43:19 +00:00
|
|
|
#pragma once
|
2003-11-18 20:49:39 +00:00
|
|
|
|
2012-07-29 11:20:05 +00:00
|
|
|
/* DCPATH flPath */
|
|
|
|
enum _DCPATHFLAGS
|
|
|
|
{
|
|
|
|
DCPATH_ACTIVE = 0x0001,
|
|
|
|
DCPATH_SAVE = 0x0002,
|
|
|
|
DCPATH_CLOCKWISE = 0x0004,
|
|
|
|
|
|
|
|
/* ReactOS only */
|
|
|
|
DCPATH_SAVESTATE = 0x80000000
|
|
|
|
};
|
2008-06-27 00:06:46 +00:00
|
|
|
|
|
|
|
typedef HGDIOBJ HPATH, *PHPATH;
|
|
|
|
|
|
|
|
typedef enum tagGdiPathState
|
|
|
|
{
|
|
|
|
PATH_Null,
|
|
|
|
PATH_Open,
|
|
|
|
PATH_Closed
|
|
|
|
} GdiPathState;
|
|
|
|
|
2017-07-13 17:30:15 +00:00
|
|
|
// Path type flags
|
|
|
|
#define PATHTYPE_KEEPME 1
|
|
|
|
#define PATHTYPE_STACK 2
|
|
|
|
|
2017-10-04 16:03:32 +00:00
|
|
|
/* extended PATHDATA */
|
|
|
|
typedef struct _EXTPATHDATA
|
|
|
|
{
|
|
|
|
PATHDATA pd;
|
|
|
|
struct _EXTPATHDATA *ppdNext;
|
|
|
|
} EXTPATHDATA, *PEXTPATHDATA;
|
|
|
|
|
2008-06-19 01:47:57 +00:00
|
|
|
typedef struct _PATH
|
|
|
|
{
|
|
|
|
BASEOBJECT BaseObject;
|
2017-07-13 17:30:15 +00:00
|
|
|
//PVOID ppachain;
|
2008-06-19 01:47:57 +00:00
|
|
|
RECTFX rcfxBoundBox;
|
|
|
|
POINTFX ptfxSubPathStart;
|
2017-07-13 17:30:15 +00:00
|
|
|
FLONG flType;
|
2017-10-04 16:03:32 +00:00
|
|
|
PEXTPATHDATA ppdFirst;
|
|
|
|
PEXTPATHDATA ppdLast;
|
2017-07-13 17:30:15 +00:00
|
|
|
FLONG flags; // PATHDATA flags.
|
2017-10-04 16:03:32 +00:00
|
|
|
PEXTPATHDATA ppdCurrent;
|
2017-07-13 17:30:15 +00:00
|
|
|
// PATHOBJ;
|
|
|
|
FLONG fl; // Saved flags.
|
|
|
|
ULONG cCurves; // Saved number of lines and Bezier.
|
2008-06-19 01:47:57 +00:00
|
|
|
|
2017-10-04 16:03:32 +00:00
|
|
|
struct _EPATHOBJ *epo;
|
|
|
|
|
2017-07-13 17:30:15 +00:00
|
|
|
// Wine/ReactOS Things to convert from:
|
|
|
|
FLONG state;
|
2008-06-19 01:47:57 +00:00
|
|
|
POINT *pPoints;
|
|
|
|
BYTE *pFlags;
|
|
|
|
int numEntriesUsed;
|
|
|
|
int numEntriesAllocated;
|
|
|
|
BOOL newStroke;
|
2016-09-08 22:37:41 +00:00
|
|
|
POINT pos;
|
2008-06-19 01:47:57 +00:00
|
|
|
} PATH, *PPATH;
|
|
|
|
|
|
|
|
typedef struct _EPATHOBJ
|
|
|
|
{
|
2017-07-13 17:30:15 +00:00
|
|
|
PATHOBJ po;
|
|
|
|
PPATH pPath;
|
|
|
|
CLIPOBJ *pco;
|
2008-06-19 01:47:57 +00:00
|
|
|
} EPATHOBJ, *PEPATHOBJ;
|
|
|
|
|
|
|
|
#define PATH_AllocPath() ((PPATH) GDIOBJ_AllocObj(GDIObjType_PATH_TYPE))
|
[WIN32K]
Rewrite of the GDI handle manager
- The old handle manager used a completely retarded spinlock in combination with KeDelayExecutionThread() for both exclusive
and shared locks. This is probably the most uneffective algorithm possible. It was also duplicating code everywhere and it was a overall mess It
is now replaced with a lock-free reference counter for shared locks and a pushlock for exclusive locks. -> Better performance and scalability.
- Allocate user mode object attributes from the new gdi pool. This way, we don't need any caching, since the pool serves as a cache. Its also
much faster and uses much less memory.
- Allow object allocations of different size, instead of fixed size from a table. This way a single allocation can take care of actual needs.
- Allow allcoating objects without a handle and insert them into the handle table later
- Properly synchronize the process GDIHandleCount. Now gdiview and taskmanager show the correct number of gdi handles.
- Implement a new event tracking system, that is capable of tracking all reverences and locks of objects and pool allocations to help track
possible leaks
- Make sure that all objects of a process are deleted in cleanup
- Make sure all usermode memory allocations are freed, when cleaning up the process pool.
- Make sure that each object type is using the correct type of lock (either shared or exclusive, not a mixture)
- Fix some object / reference leaks
- Lots of inferface improvements
- Use global variables for certain things instead of members in the mapped gdi handle table
- Make IntSysCreateRectpRgn create a region without a handle
- Fix detection od source and mask use in GreStretchBltMask
- Use GDIOBJ_bLockMultipleObjects in NtGdiCombineRegion to avoid possible deadlocks
- Fix NtGdiAbortPath to reset DCPATH_ACTIVE flag in the dc and only bail out on error, instead of always
- Replace DC_AllocateDcAttr and DC_AllocDcAttr with DC_bAllocDcAttr using the new user mode pool
- Remove DCU_SyncDcAttrtoUser and DCU_SynchDcAttrtoUser. Those functions were unused and didn't do anything useful anyway,
- Replace IntGdiSetDCOwnerEx and DC_SetOwnership with GreSetDCOwner, remove unused NoSetBrush parameter
- Replace GDIOBJ_bValidateHandle and IsObjectDead with GreIsHandleValid
- Chage GDIOBJ_bLockMultipleObjects: pass object type, return a BOOL, whether all objects could be locked, cleanup on failure
svn path=/trunk/; revision=51470
2011-04-28 08:26:46 +00:00
|
|
|
#define PATH_AllocPathWithHandle() ((PPATH) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_PATH, sizeof(PATH)))
|
2008-06-27 00:06:46 +00:00
|
|
|
#define PATH_LockPath(hPath) ((PPATH)GDIOBJ_ShareLockObj((HGDIOBJ)hPath, GDI_OBJECT_TYPE_PATH))
|
[WIN32K]
Rewrite of the GDI handle manager
- The old handle manager used a completely retarded spinlock in combination with KeDelayExecutionThread() for both exclusive
and shared locks. This is probably the most uneffective algorithm possible. It was also duplicating code everywhere and it was a overall mess It
is now replaced with a lock-free reference counter for shared locks and a pushlock for exclusive locks. -> Better performance and scalability.
- Allocate user mode object attributes from the new gdi pool. This way, we don't need any caching, since the pool serves as a cache. Its also
much faster and uses much less memory.
- Allow object allocations of different size, instead of fixed size from a table. This way a single allocation can take care of actual needs.
- Allow allcoating objects without a handle and insert them into the handle table later
- Properly synchronize the process GDIHandleCount. Now gdiview and taskmanager show the correct number of gdi handles.
- Implement a new event tracking system, that is capable of tracking all reverences and locks of objects and pool allocations to help track
possible leaks
- Make sure that all objects of a process are deleted in cleanup
- Make sure all usermode memory allocations are freed, when cleaning up the process pool.
- Make sure that each object type is using the correct type of lock (either shared or exclusive, not a mixture)
- Fix some object / reference leaks
- Lots of inferface improvements
- Use global variables for certain things instead of members in the mapped gdi handle table
- Make IntSysCreateRectpRgn create a region without a handle
- Fix detection od source and mask use in GreStretchBltMask
- Use GDIOBJ_bLockMultipleObjects in NtGdiCombineRegion to avoid possible deadlocks
- Fix NtGdiAbortPath to reset DCPATH_ACTIVE flag in the dc and only bail out on error, instead of always
- Replace DC_AllocateDcAttr and DC_AllocDcAttr with DC_bAllocDcAttr using the new user mode pool
- Remove DCU_SyncDcAttrtoUser and DCU_SynchDcAttrtoUser. Those functions were unused and didn't do anything useful anyway,
- Replace IntGdiSetDCOwnerEx and DC_SetOwnership with GreSetDCOwner, remove unused NoSetBrush parameter
- Replace GDIOBJ_bValidateHandle and IsObjectDead with GreIsHandleValid
- Chage GDIOBJ_bLockMultipleObjects: pass object type, return a BOOL, whether all objects could be locked, cleanup on failure
svn path=/trunk/; revision=51470
2011-04-28 08:26:46 +00:00
|
|
|
#define PATH_UnlockPath(pPath) GDIOBJ_vDereferenceObject((POBJ)pPath)
|
2009-03-20 14:16:01 +00:00
|
|
|
#define PATH_IsPathOpen(dclevel) ( ((dclevel).hPath) && ((dclevel).flPath & DCPATH_ACTIVE) )
|
2005-12-28 20:31:44 +00:00
|
|
|
|
2016-09-08 22:37:41 +00:00
|
|
|
BOOL FASTCALL PATH_Arc (PDC dc, INT x1, INT y1, INT x2, INT y2, INT xStart, INT yStart, INT xEnd, INT yEnd, INT direction, INT lines);
|
2021-03-31 14:17:02 +00:00
|
|
|
BOOL PATH_Ellipse (PDC dc, INT x1, INT y1, INT x2, INT y2);
|
2021-12-06 11:44:06 +00:00
|
|
|
PPATH FASTCALL PATH_CreatePath(int count);
|
2008-06-27 00:06:46 +00:00
|
|
|
VOID FASTCALL PATH_EmptyPath (PPATH pPath);
|
2003-08-17 17:32:58 +00:00
|
|
|
BOOL FASTCALL PATH_LineTo (PDC dc, INT x, INT y);
|
2021-12-06 11:44:06 +00:00
|
|
|
BOOL FASTCALL PATH_MoveTo(PDC dc, PPATH pPath);
|
2003-08-17 17:32:58 +00:00
|
|
|
BOOL FASTCALL PATH_PolyBezier (PDC dc, const POINT *pts, DWORD cbPoints);
|
|
|
|
BOOL FASTCALL PATH_PolyBezierTo (PDC dc, const POINT *pts, DWORD cbPoints);
|
2011-10-20 12:02:15 +00:00
|
|
|
BOOL FASTCALL PATH_PolyDraw(PDC dc, const POINT *pts, const BYTE *types, DWORD cbPoints);
|
2003-08-17 17:32:58 +00:00
|
|
|
BOOL FASTCALL PATH_PolylineTo (PDC dc, const POINT *pts, DWORD cbPoints);
|
|
|
|
BOOL FASTCALL PATH_PolyPolygon ( PDC dc, const POINT* pts, const INT* counts, UINT polygons);
|
|
|
|
BOOL FASTCALL PATH_PolyPolyline( PDC dc, const POINT* pts, const DWORD* counts, DWORD polylines);
|
|
|
|
BOOL FASTCALL PATH_Rectangle (PDC dc, INT x1, INT y1, INT x2, INT y2);
|
2021-03-31 14:17:02 +00:00
|
|
|
BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height);
|
2014-09-17 09:54:27 +00:00
|
|
|
BOOL FASTCALL PATH_PathToRegion (PPATH pPath, INT nPolyFillMode, PREGION Rgn);
|
2009-03-19 01:42:34 +00:00
|
|
|
BOOL FASTCALL PATH_ExtTextOut(PDC dc,INT x,INT y,UINT flags,const RECTL *lprc,LPCWSTR str,UINT count,const INT *dx);
|
2003-11-18 20:49:39 +00:00
|
|
|
|
2011-09-20 19:41:33 +00:00
|
|
|
BOOL FASTCALL PATH_AddEntry (PPATH pPath, const POINT *pPoint, BYTE flags);
|
|
|
|
BOOL FASTCALL PATH_AddFlatBezier (PPATH pPath, POINT *pt, BOOL closed);
|
|
|
|
BOOL FASTCALL PATH_FillPath( PDC dc, PPATH pPath );
|
2018-08-24 11:37:59 +00:00
|
|
|
BOOL FASTCALL PATH_FillPathEx(PDC dc, PPATH pPath, PBRUSH pbrFill);
|
2016-09-08 22:37:41 +00:00
|
|
|
PPATH FASTCALL PATH_FlattenPath (PPATH pPath);
|
2021-12-06 11:44:06 +00:00
|
|
|
PPATH FASTCALL PATH_WidenPathEx(DC *dc, PPATH pPath);
|
2011-09-20 19:41:33 +00:00
|
|
|
|
|
|
|
BOOL FASTCALL PATH_ReserveEntries (PPATH pPath, INT numEntries);
|
|
|
|
BOOL FASTCALL PATH_StrokePath(DC *dc, PPATH pPath);
|
|
|
|
|
2008-06-27 00:06:46 +00:00
|
|
|
VOID FASTCALL IntGdiCloseFigure(PPATH pPath);
|
|
|
|
BOOL FASTCALL PATH_Delete(HPATH hPath);
|
2011-09-20 19:41:33 +00:00
|
|
|
|
|
|
|
VOID FASTCALL IntGetCurrentPositionEx(PDC dc, LPPOINT pt);
|
2016-09-08 22:37:41 +00:00
|
|
|
|
|
|
|
BOOL PATH_RestorePath( DC *, DC *);
|
|
|
|
BOOL PATH_SavePath( DC *, DC *);
|
2018-08-24 11:37:59 +00:00
|
|
|
BOOL IntGdiFillRgn(PDC pdc, PREGION prgn, PBRUSH pbrFill);
|
2018-10-27 20:13:08 +00:00
|
|
|
PPATH FASTCALL
|
|
|
|
IntGdiWidenPath(PPATH pPath, UINT penWidth, UINT penStyle, FLOAT eMiterLimit);
|