From e3e0ea837f5109ece0939f6d92eb184176085e2b Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 27 Dec 2019 13:50:48 -0800 Subject: [PATCH] evas: don't initialize font multiple time. After splitting font family and size set operation, expedite lost a 10% speed due to doing a double initialization (Once when the family is set and one when the size is set). This was noticable in a few tight running tests. This patch enforce that no initialization is called until the size and the family are set. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10976 --- src/lib/evas/canvas/evas_object_text.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 3a96909..30e781b 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -431,6 +431,8 @@ _evas_text_font_reload(Eo *eo_obj, Evas_Text_Data *o) Eina_Bool source_invisible = EINA_FALSE; Eina_List *was = NULL; + if (o->cur.size == 0 || (!o->cur.font && !o->cur.source)) return ; + if (!(obj->layer->evas->is_frozen)) { pass = evas_event_passes_through(eo_obj, obj); -- 2.7.4