[ros-diffs] [jimtabor] 33424: Fix brush attribute structure and add flags. Add gdi handle cache structures.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Sun May 11 07:32:51 CEST 2008


Author: jimtabor
Date: Sun May 11 00:32:50 2008
New Revision: 33424

URL: http://svn.reactos.org/svn/reactos?rev=33424&view=rev
Log:
Fix brush attribute structure and add flags. Add gdi handle cache structures.

Modified:
    trunk/reactos/dll/win32/gdi32/main/dllmain.c
    trunk/reactos/include/reactos/win32k/ntgdihdl.h
    trunk/reactos/include/reactos/win32k/ntgdityp.h

Modified: trunk/reactos/dll/win32/gdi32/main/dllmain.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/main/dllmain.c?rev=33424&r1=33423&r2=33424&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/main/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/main/dllmain.c [iso-8859-1] Sun May 11 00:32:50 2008
@@ -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 @@
 	GdiDevCaps = &GdiSharedHandleTable->DevCaps;
 	CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess;
 	GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList;
+	GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
 }
 
 

Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgdihdl.h?rev=33424&r1=33423&r2=33424&view=diff
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] Sun May 11 00:32:50 2008
@@ -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 @@
     RGN_ATTR VisRectRegion;
 } DC_ATTR, *PDC_ATTR;
 
-typedef struct _BRUSH_ATTR
-{
-    LOGBRUSH logbrush;
-    DWORD    dwUnused[3];
+typedef struct _BRUSH_ATTR // Used with pen too.
+{
+    FLONG    AttrFlags;
+    COLORREF lbColor;
 } BRUSH_ATTR, *PBRUSH_ATTR;
 
 typedef struct _FONT_ATTR

Modified: trunk/reactos/include/reactos/win32k/ntgdityp.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgdityp.h?rev=33424&r1=33423&r2=33424&view=diff
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdityp.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntgdityp.h [iso-8859-1] Sun May 11 00:32:50 2008
@@ -159,8 +159,8 @@
 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)
@@ -269,6 +269,28 @@
     ULONG ulShadeBlend;
     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



More information about the Ros-diffs mailing list