From ff3a370b9b7a996a53d795d52184516b2289960d Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sun, 23 Dec 2012 11:02:50 +0000 Subject: [PATCH] font draw - dont alloc font props for 32 chrs.. if we are only ever going to have less than 32.. eg textgrid. 1 per prop. SVN revision: 81654 --- src/lib/evas/common/evas_font_draw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c index 8bc57a3c50..f7c5682e25 100644 --- a/src/lib/evas/common/evas_font_draw.c +++ b/src/lib/evas/common/evas_font_draw.c @@ -404,6 +404,7 @@ evas_common_font_draw_prepare(Evas_Text_Props *text_props) RGBA_Font_Int *fi; RGBA_Font_Glyph *fg; Eina_Inarray *glyphs; + size_t unit = 32; EVAS_FONT_WALK_TEXT_INIT(); fi = text_props->font_instance; @@ -412,7 +413,8 @@ evas_common_font_draw_prepare(Evas_Text_Props *text_props) if (!text_props->changed && text_props->generation == fi->generation && text_props->glyphs) return; - glyphs = eina_inarray_new(sizeof(Evas_Glyph), 32); + if (text_props->len < unit) unit = text_props->len; + glyphs = eina_inarray_new(sizeof(Evas_Glyph), unit); evas_common_font_int_reload(fi); if (fi->src->current_size != fi->size)