summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2018-11-19 15:30:25 -0600
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-22 16:09:38 +0100
commita4e434308202d751d5f04b71e3968e40a3911219 (patch)
tree8c0949f4562cbf0a6fb137310d23a1900fe3fe2a /src
parent390871832d34eeeccb138ec8b6d3bf8f4a65f832 (diff)
elm: speed up _eval_registration_candidate
combining _tree_unfocusable and _tree_disabled into a single function reduces eo overhead. This saves a few ms at startup in elementary_test. Differential Revision: https://phab.enlightenment.org/D7308 Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_widget.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 5877facd7b..87b805aba9 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -338,20 +338,6 @@ _efl_ui_widget_focus_highlight_style_get(const Eo *obj, Elm_Widget_Smart_Data *s
338} 338}
339 339
340static Eina_Bool 340static Eina_Bool
341_tree_unfocusable(Eo *obj)
342{
343 Efl_Ui_Widget *wid = obj;
344
345 do {
346 ELM_WIDGET_DATA_GET(wid, wid_pd);
347
348 if (wid_pd->tree_unfocusable) return EINA_TRUE;
349 } while((wid = elm_widget_parent_widget_get(wid)));
350
351 return EINA_FALSE;
352}
353
354static Eina_Bool
355_tree_custom_chain_missing(Eo *obj) 341_tree_custom_chain_missing(Eo *obj)
356{ 342{
357 Efl_Ui_Widget *wid = obj; 343 Efl_Ui_Widget *wid = obj;
@@ -378,7 +364,7 @@ _tree_custom_chain_missing(Eo *obj)
378} 364}
379 365
380static Eina_Bool 366static Eina_Bool
381_tree_disabled(Eo *obj) 367_tree_disabled_or_unfocusable(Eo *obj)
382{ 368{
383 Efl_Ui_Widget *wid = obj; 369 Efl_Ui_Widget *wid = obj;
384 370
@@ -386,6 +372,7 @@ _tree_disabled(Eo *obj)
386 ELM_WIDGET_DATA_GET(wid, wid_pd); 372 ELM_WIDGET_DATA_GET(wid, wid_pd);
387 373
388 if (wid_pd->disabled) return EINA_TRUE; 374 if (wid_pd->disabled) return EINA_TRUE;
375 if (wid_pd->tree_unfocusable) return EINA_TRUE;
389 } while((wid = elm_widget_parent_widget_get(wid))); 376 } while((wid = elm_widget_parent_widget_get(wid)));
390 377
391 return EINA_FALSE; 378 return EINA_FALSE;
@@ -498,8 +485,7 @@ _eval_registration_candidate(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool *shou
498 //can focus can be overridden by the following properties 485 //can focus can be overridden by the following properties
499 if (!efl_isa(elm_widget_top_get(obj), EFL_UI_WIN_CLASS) || 486 if (!efl_isa(elm_widget_top_get(obj), EFL_UI_WIN_CLASS) ||
500 (!pd->parent_obj) || 487 (!pd->parent_obj) ||
501 (_tree_unfocusable(obj)) || 488 (_tree_disabled_or_unfocusable(obj)) ||
502 (_tree_disabled(obj)) ||
503 (_tree_custom_chain_missing(obj)) || 489 (_tree_custom_chain_missing(obj)) ||
504 (!evas_object_visible_get(obj))) 490 (!evas_object_visible_get(obj)))
505 return; 491 return;