summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-05-12 11:20:15 -0400
committerMike Blumenkrantz <zmike@samsung.com>2020-05-12 11:21:01 -0400
commit67bf9eae6c72bedd3c0f28acf1c649d94f1e5478 (patch)
tree5d17968499fd629af63ee870be3633042c8dded2
parent568359366985066b3346df0d1161d4c9cdd062cd (diff)
Efl.Ui.Button_Legacy: Prevent duplicate signal emit of contents
Summary: When call elm_button_add, theme_apply of layout is called and _efl_ui_button_legacy_efl_ui_widget_theme_apply is called. Then it calls the signal emit for the icon. In the button theme, the default of the icon is hidden, so this call is unnecessary. Test Plan: Evas_Object *bt; clock_t start, finish; start = clock(); bt = elm_button_add(win); finish = clock(); printf("duration : %f\n", (double)(finish-start)/CLOCKS_PER_SEC); Evas_Object *bt; clock_t start, finish; double sum= 0 ; double avg = 0; double cnt = 1000; for(int i =0 ; i<(int)cnt; i++) { start = clock(); bt = elm_button_add(win); finish = clock(); sum += (double)(finish-start)/CLOCKS_PER_SEC; } avg = sum / cnt ; printf("button avg : %f %f\n",avg, sum); [before] button avg : 0.000215 [after] button avg : 0.000138 Reviewers: Hermet, YOhoho, Jaehyun_Cho, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11810
-rw-r--r--src/lib/elementary/efl_ui_button.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c
index 7c0a13e478..8f8e8a664f 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -422,7 +422,7 @@ _efl_ui_button_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
422 422
423 int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS)); 423 int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS));
424 if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; 424 if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;
425 _icon_signal_emit(obj); 425 if (efl_finalized_get(obj)) _icon_signal_emit(obj);
426 426
427 return int_ret; 427 return int_ret;
428} 428}