summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-02-21 17:48:08 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-02-21 17:49:22 +0900
commit81fbd54c17e84514d3f74a795b2a6db189df9533 (patch)
treeed818749acdc1fb5508622fd7e5db9e781d26b03 /src/lib
parentaac07ca6c1840cf6ad347134147582427af79e2e (diff)
evas: Optimize out some nop calls to evas text
Some property set calls to Evas Text are NOPs if the property was already set to the same value. Avoid doing any work then. This adds a missing intercept call (size_set as it's overriden by Evas.Text).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/evas/canvas/evas_object_text.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 1d3650dc0a..2e243be884 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -400,8 +400,9 @@ EOLIAN static void
400_evas_text_efl_text_properties_font_source_set(Eo *eo_obj, Evas_Text_Data *o, const char *font_source) 400_evas_text_efl_text_properties_font_source_set(Eo *eo_obj, Evas_Text_Data *o, const char *font_source)
401{ 401{
402 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 402 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
403 if ((o->cur.source) && (font_source) && 403 if (((o->cur.source) && (font_source) &&
404 (!strcmp(o->cur.source, font_source))) 404 (!strcmp(o->cur.source, font_source))) ||
405 (!o->cur.source && !font_source))
405 return; 406 return;
406 evas_object_async_block(obj); 407 evas_object_async_block(obj);
407 /* 408 /*
@@ -427,10 +428,12 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha
427 Evas_Font_Description *fdesc; 428 Evas_Font_Description *fdesc;
428 Eina_List *was = NULL; 429 Eina_List *was = NULL;
429 430
430
431 if ((!font) || (size <= 0)) return; 431 if ((!font) || (size <= 0)) return;
432 432
433 evas_object_async_block(obj); 433 evas_object_async_block(obj);
434 if ((size == o->cur.size) &&
435 ((!font && !o->cur.font) ||
436 (font && o->cur.font && !strcmp(font, o->cur.font)))) return;
434 437
435 /* We can't assume the given font is same with current fdesc by comparing string. 438 /* We can't assume the given font is same with current fdesc by comparing string.
436 Since Evas starts to supporting "auto" for language, 439 Since Evas starts to supporting "auto" for language,
@@ -1002,7 +1005,9 @@ _evas_text_efl_gfx_size_set(Eo *eo_obj, Evas_Text_Data *o, int w, int h)
1002{ 1005{
1003 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 1006 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1004 1007
1005 evas_object_async_block(obj); 1008 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, w, h))
1009 return;
1010
1006 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur) 1011 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
1007 { 1012 {
1008 state_write->geometry.w = w; 1013 state_write->geometry.w = w;