From: tasn Date: Tue, 18 Oct 2011 09:58:49 +0000 (+0000) Subject: Evas font: Oops, hb_fonts should be per font instance, not source. X-Git-Tag: 2.0_alpha~193^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4771ec752e59bd449f9096f9fde42b136b9b4a5;p=framework%2Fuifw%2Fevas.git Evas font: Oops, hb_fonts should be per font instance, not source. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@64144 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/engines/common/evas_font_load.c b/src/lib/engines/common/evas_font_load.c index c39becd..98b47f9 100644 --- a/src/lib/engines/common/evas_font_load.c +++ b/src/lib/engines/common/evas_font_load.c @@ -56,9 +56,6 @@ _evas_common_font_source_free(RGBA_Font_Source *fs) { FTLOCK(); FT_Done_Face(fs->ft.face); -#ifdef USE_HARFBUZZ - hb_font_destroy(fs->ft.hb_font); -#endif FTUNLOCK(); if (fs->name) eina_stringshare_del(fs->name); if (fs->file) eina_stringshare_del(fs->file); @@ -77,6 +74,9 @@ _evas_common_font_int_free(RGBA_Font_Int *fi) #ifdef HAVE_PTHREAD pthread_mutex_destroy(&fi->ft_mutex); #endif +#ifdef USE_HARFBUZZ + hb_font_destroy(fi->ft.hb_font); +#endif evas_common_font_source_free(fi->src); if (fi->references == 0) fonts_lru = eina_list_remove(fonts_lru, fi); if (fi->fash) fi->fash->freeme(fi->fash); diff --git a/src/lib/engines/common/evas_font_ot.c b/src/lib/engines/common/evas_font_ot.c index cb1eada..2912d55 100644 --- a/src/lib/engines/common/evas_font_ot.c +++ b/src/lib/engines/common/evas_font_ot.c @@ -246,19 +246,19 @@ static void _evas_common_font_ot_shape(hb_buffer_t *buffer, RGBA_Font_Int *fi) { /* Create hb_font if not previously created */ - if (!fi->src->ft.hb_font) + if (!fi->ft.hb_font) { hb_font_t *hb_ft_font; hb_ft_font = hb_ft_font_create(fi->src->ft.face, NULL); - fi->src->ft.hb_font = hb_font_create_sub_font(hb_ft_font); + fi->ft.hb_font = hb_font_create_sub_font(hb_ft_font); hb_font_destroy(hb_ft_font); - hb_font_set_funcs(fi->src->ft.hb_font, + hb_font_set_funcs(fi->ft.hb_font, _evas_common_font_ot_font_funcs_get(), fi, NULL); } - hb_shape(fi->src->ft.hb_font, buffer, NULL, 0); + hb_shape(fi->ft.hb_font, buffer, NULL, 0); } EAPI Eina_Bool diff --git a/src/lib/include/evas_common.h b/src/lib/include/evas_common.h index d518fcc..e0b1ff1 100644 --- a/src/lib/include/evas_common.h +++ b/src/lib/include/evas_common.h @@ -906,6 +906,8 @@ struct _RGBA_Font unsigned char sizeok : 1; }; +#include "../engines/common/evas_font_ot.h" + struct _RGBA_Font_Int { EINA_INLIST; @@ -919,6 +921,9 @@ struct _RGBA_Font_Int int usage; struct { FT_Size size; +#ifdef USE_HARFBUZZ + void *hb_font; +#endif } ft; LK(ft_mutex); Font_Hint_Flags hinting; @@ -929,8 +934,6 @@ struct _RGBA_Font_Int unsigned char inuse : 1; }; -#include "../engines/common/evas_font_ot.h" - struct _RGBA_Font_Source { const char *name; @@ -942,9 +945,6 @@ struct _RGBA_Font_Source struct { int orig_upem; FT_Face face; -#ifdef USE_HARFBUZZ - void *hb_font; -#endif } ft; };