increased the number of cached GDI resources
authorClaus Gittinger <cg@exept.de>
Thu, 17 Nov 2016 14:21:07 +0100
changeset 7680 6597c1842893
parent 7679 f95ec06b4df6
child 7681 924632d9eacf
increased the number of cached GDI resources
WinWorkstation.st
--- a/WinWorkstation.st	Wed Nov 16 11:08:30 2016 +0100
+++ b/WinWorkstation.st	Thu Nov 17 14:21:07 2016 +0100
@@ -100,13 +100,15 @@
 #define CACHE_LAST_DC                   /* remember last DC in gcData */
 
 #ifdef CACHE_PEN
-# define NUM_PEN_CACHED       16        /* that many solid pens are globally remembered */
+# define xNUM_PEN_CACHED       16        /* that many solid pens are globally remembered */
+# define NUM_PEN_CACHED       64        /* that many solid pens are globally remembered */
 #else
 # define NUM_PEN_CACHED       0
 #endif
 
 #ifdef CACHE_BRUSH
-# define NUM_BRUSH_CACHED     16         /* that many brushes are globally remembered */
+# define xNUM_BRUSH_CACHED     16         /* that many brushes are globally remembered */
+# define NUM_BRUSH_CACHED     64         /* that many brushes are globally remembered */
 #else
 # define NUM_BRUSH_CACHED     0
 #endif
@@ -1057,7 +1059,8 @@
  * up to NUM_FREE_GC gc's are kept in a local list
  * (away from free/malloc)
  */
-#define NUM_FREE_GC     50
+#define xNUM_FREE_GC     50
+#define NUM_FREE_GC     150
 static struct gcData *gcDataFreeList = (struct gcData *)0;
 static int gcDataNumFree = 0;
 
@@ -9527,37 +9530,37 @@
     r := g := b := 0.
     found := false.
     (colorName startsWith:$#) ifTrue:[
-        "/ color in r/g/b hex notation
-        colorName size == 7 ifTrue:[
-            r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16 onError:[nil].
-            g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16 onError:[nil].
-            b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16 onError:[nil].
-        ].
-        (r isNil or:[g isNil or:[b isNil]]) ifTrue:[^ nil].
-        found := true.
+	"/ color in r/g/b hex notation
+	colorName size == 7 ifTrue:[
+	    r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16 onError:[nil].
+	    g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16 onError:[nil].
+	    b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16 onError:[nil].
+	].
+	(r isNil or:[g isNil or:[b isNil]]) ifTrue:[^ nil].
+	found := true.
     ] ifFalse:[
-        cName := colorName asString.
-        triple := StandardColorValues at:cName ifAbsent:nil.
-        triple isNil ifTrue:[
-            "/ try lowercase name
-            cName := cName asLowercase.
-            triple := StandardColorValues at:cName ifAbsent:nil.
-            triple isNil ifTrue:[
-                "/ try lowercase without intermixed spaces
-                cName := cName asCollectionOfWords asStringWith:nil.
-                triple := StandardColorValues at:cName ifAbsent:nil.
-            ].
-        ].
-        triple notNil ifTrue:[
-            r := triple at:1.
-            g := triple at:2.
-            b := triple at:3.
-            found := true.
-        ].
+	cName := colorName asString.
+	triple := StandardColorValues at:cName ifAbsent:nil.
+	triple isNil ifTrue:[
+	    "/ try lowercase name
+	    cName := cName asLowercase.
+	    triple := StandardColorValues at:cName ifAbsent:nil.
+	    triple isNil ifTrue:[
+		"/ try lowercase without intermixed spaces
+		cName := cName asCollectionOfWords asStringWith:nil.
+		triple := StandardColorValues at:cName ifAbsent:nil.
+	    ].
+	].
+	triple notNil ifTrue:[
+	    r := triple at:1.
+	    g := triple at:2.
+	    b := triple at:3.
+	    found := true.
+	].
     ].
     found ifFalse:[
-        "/ ('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
-        ^ nil.
+	"/ ('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
+	^ nil.
     ].
 
     ^ aBlock value:((r * 256) + r) value:((g * 256) + g) value:((b * 256) + b)