diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2011-03-06 11:15:48 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2011-03-06 11:15:48 +0000 |
commit | 884e766eb8b233bf873fa92f0893aed528fb3018 (patch) | |
tree | 22ee192784b33faf3b0fe963793858feca146323 /gs | |
parent | 004b8e6be17ac515e9dd88e314659ec5b601251b (diff) |
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.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@12244 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs')
-rw-r--r-- | gs/psi/fapi_ft.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gs/psi/fapi_ft.c b/gs/psi/fapi_ft.c index 91e1aee00..67ce95841 100644 --- a/gs/psi/fapi_ft.c +++ b/gs/psi/fapi_ft.c @@ -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 @@ get_char_outline(FAPI_server *a_server, FAPI_path *a_path) 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; |