tinus <o112w8r02@sneakemail.com>
Add a Initialized member to TEXTOBJ so it isn't reinitialized all the time.
Modified: trunk/reactos/include/win32k/text.h
Modified: trunk/reactos/subsys/win32k/objects/text.c

Modified: trunk/reactos/include/win32k/text.h
--- trunk/reactos/include/win32k/text.h	2005-03-11 18:17:29 UTC (rev 13933)
+++ trunk/reactos/include/win32k/text.h	2005-03-11 18:34:44 UTC (rev 13934)
@@ -7,6 +7,7 @@
 {
    LOGFONTW   logfont;
    FONTOBJ    *Font;
+   BOOLEAN Initialized; /* Don't reinitialize for each DC */
 } TEXTOBJ, *PTEXTOBJ;
 
 /*  Internal interface  */

Modified: trunk/reactos/subsys/win32k/objects/text.c
--- trunk/reactos/subsys/win32k/objects/text.c	2005-03-11 18:17:29 UTC (rev 13933)
+++ trunk/reactos/subsys/win32k/objects/text.c	2005-03-11 18:34:44 UTC (rev 13934)
@@ -2971,6 +2971,12 @@
       return STATUS_INVALID_HANDLE;
     }
 
+  if (TextObj->Initialized)
+    {
+      TEXTOBJ_UnlockText(FontHandle);
+      return STATUS_SUCCESS;
+    }
+
   if (! RtlCreateUnicodeString(&FaceName, TextObj->logfont.lfFaceName))
     {
       TEXTOBJ_UnlockText(FontHandle);
@@ -3003,6 +3009,7 @@
     }
   else
     {
+      TextObj->Initialized = TRUE;
       Status = STATUS_SUCCESS;
     }