[gs-commits] rev 12244 - trunk/gs/psi

chrisl at ghostscript.com chrisl at ghostscript.com
Sun Mar 6 11:15:48 UTC 2011


Author: chrisl
Date: 2011-03-06 11:15:48 +0000 (Sun, 06 Mar 2011)
New Revision: 12244

Modified:
   trunk/gs/psi/fapi_ft.c
Log:
Instead of destroying and recreating freetype's glyph object for every glyph
we need to render, we can just free the "transient" parts: the bitmap or the
outline.

Saves a very small amount of time, and potentially reduces memory pool
fragmentation.

No cluster differences expected.



Modified: trunk/gs/psi/fapi_ft.c
===================================================================
--- trunk/gs/psi/fapi_ft.c	2011-03-05 17:46:46 UTC (rev 12243)
+++ trunk/gs/psi/fapi_ft.c	2011-03-06 11:15:48 UTC (rev 12244)
@@ -43,6 +43,7 @@
 #include FT_BBOX_H
 #include FT_OUTLINE_H
 #include FT_IMAGE_H
+#include FT_BITMAP_H
 
 /* Note: structure definitions here start with FF_, which stands for 'FAPI FreeType". */
 
@@ -1283,8 +1284,15 @@
 static FAPI_retcode release_char_data(FAPI_server *a_server)
 {
     FF_server *s = (FF_server*)a_server;
-    FT_Done_Glyph(&s->outline_glyph->root);
-    FT_Done_Glyph(&s->bitmap_glyph->root);
+    
+    if (s->outline_glyph) {
+        FT_Outline_Done (s->freetype_library, &s->outline_glyph->outline);
+    }
+    
+    if (s->bitmap_glyph) {
+        FT_Bitmap_Done (s->freetype_library, &s->bitmap_glyph->bitmap);
+    }
+
     s->outline_glyph = NULL;
     s->bitmap_glyph = NULL;
     return 0;



More information about the gs-commits mailing list