From cf46337e174ab4bd273b9e33e5ff6833a3413bb8 Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Wed, 9 Jan 2013 21:37:34 +0000 Subject: [PATCH] efl/font: Dispatch font load request once sent to server Patch by: Paulo Alcantara SVN revision: 82482 --- src/lib/evas/common/evas_font_load.c | 16 ++++++++++++---- src/lib/evas/cserve2/evas_cs2_client.c | 6 +++--- src/lib/evas/cserve2/evas_cs2_private.h | 1 + 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/common/evas_font_load.c b/src/lib/evas/common/evas_font_load.c index f3be326fe3..0cb5b7dddb 100644 --- a/src/lib/evas/common/evas_font_load.c +++ b/src/lib/evas/common/evas_font_load.c @@ -347,8 +347,12 @@ evas_common_font_int_memory_load(const char *source, const char *name, int size, evas_common_font_int_load_complete(fi); #ifdef EVAS_CSERVE2 if (evas_cserve2_use_get()) - fi->cs2_handler = evas_cserve2_font_load(source, name, size, font_dpi, - wanted_rend); + { + fi->cs2_handler = evas_cserve2_font_load(source, name, size, font_dpi, + wanted_rend); + if (fi->cs2_handler) + evas_cserve2_font_load_wait((Font_Entry *)fi->cs2_handler); + } #endif free(fake_name); return fi; @@ -379,8 +383,12 @@ evas_common_font_int_load(const char *name, int size, fi = evas_common_font_int_load_init(fi); #ifdef EVAS_CSERVE2 if (evas_cserve2_use_get()) - fi->cs2_handler = evas_cserve2_font_load(NULL, name, size, font_dpi, - wanted_rend); + { + fi->cs2_handler = evas_cserve2_font_load(NULL, name, size, font_dpi, + wanted_rend); + if (fi->cs2_handler) + evas_cserve2_font_load_wait((Font_Entry *)fi->cs2_handler); + } #endif // evas_common_font_int_load_complete(fi); return fi; diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c index 7748aca5f1..9425a138b2 100644 --- a/src/lib/evas/cserve2/evas_cs2_client.c +++ b/src/lib/evas/cserve2/evas_cs2_client.c @@ -993,8 +993,8 @@ evas_cserve2_font_load(const char *source, const char *name, int size, int dpi, return fe; } -static inline int -_font_load_wait(Font_Entry *fe) +int +evas_cserve2_font_load_wait(Font_Entry *fe) { _server_dispatch_until(fe->rid); @@ -1010,7 +1010,7 @@ evas_cserve2_font_free(Font_Entry *fe) if (!fe) return; - ret = _font_load_wait(fe); + ret = evas_cserve2_font_load_wait(fe); if (ret == CSERVE2_GENERIC) { ERR("Failed to wait loading font '%s'.", fe->name); diff --git a/src/lib/evas/cserve2/evas_cs2_private.h b/src/lib/evas/cserve2/evas_cs2_private.h index 4373bfdab3..ab9b432d01 100644 --- a/src/lib/evas/cserve2/evas_cs2_private.h +++ b/src/lib/evas/cserve2/evas_cs2_private.h @@ -35,6 +35,7 @@ void evas_cserve2_dispatch(void); void *evas_cserve2_image_data_get(Image_Entry *ie); Font_Entry *evas_cserve2_font_load(const char *source, const char *name, int size, int dpi, Font_Rend_Flags wanted_rend); +EAPI int evas_cserve2_font_load_wait(Font_Entry *fe); void evas_cserve2_font_free(Font_Entry *fe); Eina_Bool evas_cserve2_font_glyph_request(Font_Entry *fe, unsigned int idx, Font_Hint_Flags hints); Eina_Bool evas_cserve2_font_glyph_used(Font_Entry *fe, unsigned int idx, Font_Hint_Flags hints);