From 534021632cfad8732cf80082561c63cc6e89df6e Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sat, 21 Sep 2019 11:06:26 +0200 Subject: [PATCH] efl_ui_position_manager: review cache accesses in position manager grid and list, there are caches for the sizes, so the access within placing the item is faster. The cache sometimes is invalidated, which means, it must be rebuild before accessing it. This commit is the result of reviewing all the accesses, that the correct item is available. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10065 --- src/lib/elementary/efl_ui_position_manager_grid.c | 2 ++ src/lib/elementary/efl_ui_position_manager_list.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/lib/elementary/efl_ui_position_manager_grid.c b/src/lib/elementary/efl_ui_position_manager_grid.c index 206bc73221..bc3124abdc 100644 --- a/src/lib/elementary/efl_ui_position_manager_grid.c +++ b/src/lib/elementary/efl_ui_position_manager_grid.c @@ -448,6 +448,8 @@ _reposition_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd) if (pd->max_min_size.w <= 0 || pd->max_min_size.h <= 0) return; if (!eina_inarray_count(pd->group_cache)) return; + _size_cache_require(obj, pd); + //space size contains the amount of space that is outside the viewport (either to the top or to the left) space_size.w = (MAX(pd->last_viewport_size.w - pd->viewport.w, 0))*pd->scroll_position.x; space_size.h = (MAX(pd->last_viewport_size.h - pd->viewport.h, 0))*pd->scroll_position.y; diff --git a/src/lib/elementary/efl_ui_position_manager_list.c b/src/lib/elementary/efl_ui_position_manager_list.c index d4bedb819c..cee6730137 100644 --- a/src/lib/elementary/efl_ui_position_manager_list.c +++ b/src/lib/elementary/efl_ui_position_manager_list.c @@ -417,6 +417,8 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_position_single_ite if (!pd->size) return EINA_RECT(0,0,0,0); + cache_require(obj, pd); + //space size contains the amount of space that is outside the viewport (either to the top or to the left) space_size.w = (MAX(pd->abs_size.w - pd->viewport.w, 0))*pd->scroll_position.x; space_size.h = (MAX(pd->abs_size.h - pd->viewport.h, 0))*pd->scroll_position.y;