Page MenuHomePhabricator

Efl.Ui.Button_Legacy: Prevent duplicate signal emit of contents
ClosedPublic

Authored by jsuya on May 11 2020, 9:50 PM.

Details

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

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jsuya created this revision.May 11 2020, 9:50 PM
jsuya requested review of this revision.May 11 2020, 9:50 PM
jsuya updated this revision to Diff 30207.May 11 2020, 10:15 PM

Fix typo

jsuya updated this revision to Diff 30211.May 11 2020, 10:38 PM

update_code

jsuya updated this revision to Diff 30218.May 12 2020, 5:17 AM

Update code - use efl_finalized_get

jsuya updated this revision to Diff 30220.May 12 2020, 5:39 AM
jsuya edited the test plan for this revision. (Show Details)

test result update

zmike added a subscriber: zmike.May 12 2020, 7:03 AM

Hm this breaks unified API usage, but technically that's unsupported for legacy widgets. Probably ok...

https://travis-ci.org/github/Enlightenment/efl/builds/686131015

zmike accepted this revision.May 12 2020, 8:20 AM
This revision is now accepted and ready to land.May 12 2020, 8:20 AM
This revision was automatically updated to reflect the committed changes.