diff --git a/reactos/dll/win32/gdi32/main/dllmain.c b/reactos/dll/win32/gdi32/main/dllmain.c index a1394488761..6b323b10418 100644 --- a/reactos/dll/win32/gdi32/main/dllmain.c +++ b/reactos/dll/win32/gdi32/main/dllmain.c @@ -12,6 +12,7 @@ extern HGDIOBJ stock_objects[]; BOOL SetStockObjects = FALSE; PDEVCAPS GdiDevCaps = NULL; +PGDIHANDLECACHE GdiHandleCache = NULL; /* * GDI32.DLL doesn't have an entry point. The initialization is done by a call @@ -41,6 +42,7 @@ GdiProcessSetup (VOID) GdiDevCaps = &GdiSharedHandleTable->DevCaps; CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess; GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList; + GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer; } diff --git a/reactos/include/reactos/win32k/ntgdihdl.h b/reactos/include/reactos/win32k/ntgdihdl.h index b7594c528b9..e2e22f8c7cb 100644 --- a/reactos/include/reactos/win32k/ntgdihdl.h +++ b/reactos/include/reactos/win32k/ntgdihdl.h @@ -186,8 +186,13 @@ #define PAGE_EXTENTS_CHANGED 0x00004000 #define WORLD_XFORM_CHANGED 0x00008000 -/* RGN_ATTR Flags */ -#define DIRTY_RGNATTR 0x00000020 +/* BRUSH/RGN_ATTR Flags */ +#define ATTR_CACHED 0x00000001 +#define ATTR_TO_BE_DELETED 0x00000002 +#define ATTR_NEW_COLOR 0x00000004 +#define ATTR_CANT_SELECT 0x00000008 +#define ATTR_RGN_VALID 0x00000010 +#define ATTR_RGN_DIRTY 0x00000020 /* TYPES *********************************************************************/ @@ -302,10 +307,10 @@ typedef struct _DC_ATTR RGN_ATTR VisRectRegion; } DC_ATTR, *PDC_ATTR; -typedef struct _BRUSH_ATTR +typedef struct _BRUSH_ATTR // Used with pen too. { - LOGBRUSH logbrush; - DWORD dwUnused[3]; + FLONG AttrFlags; + COLORREF lbColor; } BRUSH_ATTR, *PBRUSH_ATTR; typedef struct _FONT_ATTR diff --git a/reactos/include/reactos/win32k/ntgdityp.h b/reactos/include/reactos/win32k/ntgdityp.h index 8b8926bbcb5..4420f2b9670 100644 --- a/reactos/include/reactos/win32k/ntgdityp.h +++ b/reactos/include/reactos/win32k/ntgdityp.h @@ -159,8 +159,8 @@ typedef enum GDILoObjType typedef DWORD FULLSCREENCONTROL; typedef DWORD LFTYPE; -/* Public LAST_STOCK = 19, plus 2 more internal entries */ -#define NB_STOCK_OBJECTS 22 +/* Public LAST_STOCK = 19, plus 2 more internal entries */ +#define NB_STOCK_OBJECTS 22 /* extra stock object: default 1x1 bitmap for memory DCs */ #define DEFAULT_BITMAP (21) @@ -270,6 +270,28 @@ typedef struct _DEVCAPS // Very similar to GDIINFO ULONG ulColorMgmtCaps; } DEVCAPS, *PDEVCAPS; +/* Gdi Handle Cache Types and Structures */ +#define GDI_CACHED_HADNLE_TYPES 4 +#define CACHE_BRUSH_ENTRIES 10 +#define CACHE_PEN_ENTRIES 8 +#define CACHE_REGION_ENTRIES 8 +#define CACHE_LFONT_ENTRIES 1 + +typedef enum _HANDLECACHETYPE +{ + hctBrushHandle, + hctPenHandle, + hctRegionHandle, + hctLFontHandle +} HANDLECACHETYPE,*PHANDLECACHETYPE; + +typedef struct _GDIHANDLECACHE +{ + ULONG ulLock; + ULONG ulNumHandles[GDI_CACHED_HADNLE_TYPES]; + HANDLE Handle[CACHE_BRUSH_ENTRIES+CACHE_PEN_ENTRIES+CACHE_REGION_ENTRIES+CACHE_LFONT_ENTRIES]; +} GDIHANDLECACHE, *PGDIHANDLECACHE; + /* Font Structures */ typedef struct _TMDIFF {