summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-27 13:35:33 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-27 17:47:54 +0200
commit53739890ce969b064a89b0b693ab54cd92a6ce4a (patch)
treec8c699b1d75041ad43a1f883ab7431ca62cb9892 /src/tests
parent47547ff088a7a09094fad1bd41e1eb0426f677bf (diff)
efl_ui_position_manager: refactor data access
before data access has been a property on Efl.Ui.Position_Manager.Entity. However, we are not sure how stable all this will be, and maybe we have the demand to change that in future, in order to allow more high-performance item passing here. Additionally, this patch addresses a few lectures learned from the past, that includes: - direct group header filling. - direct group sizing - difference between size for caching, and size for displaying - Have a end_id which is the maximum of id that is filled. ref T8179 Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9754
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/efl_ui_test_position_manager_common.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/tests/elementary/efl_ui_test_position_manager_common.c b/src/tests/elementary/efl_ui_test_position_manager_common.c
index 5901424dc1..53f1bcbf18 100644
--- a/src/tests/elementary/efl_ui_test_position_manager_common.c
+++ b/src/tests/elementary/efl_ui_test_position_manager_common.c
@@ -25,41 +25,43 @@ item_container_teardown()
25 win = NULL; 25 win = NULL;
26} 26}
27 27
28static Efl_Ui_Position_Manager_Batch_Result 28static Efl_Ui_Position_Manager_Size_Batch_Result
29_size_accessor_get_at(void *data EINA_UNUSED, int start_id, Eina_Rw_Slice memory) 29_size_accessor_get_at(void *data EINA_UNUSED, Efl_Ui_Position_Manager_Size_Call_Config conf, Eina_Rw_Slice memory)
30{ 30{
31 int i; 31 int i;
32 Efl_Ui_Position_Manager_Batch_Size_Access *sizes = memory.mem; 32 Efl_Ui_Position_Manager_Size_Batch_Entity *sizes = memory.mem;
33 Efl_Ui_Position_Manager_Batch_Result result; 33 Efl_Ui_Position_Manager_Size_Batch_Result result;
34 34
35 for (i = start_id; i < (int)(MIN(start_id + memory.len, eina_inarray_count(arr_size))); ++i) 35 for (i = conf.range.start_id; i < (int)(MIN(conf.range.end_id, eina_inarray_count(arr_size))); ++i)
36 { 36 {
37 Eina_Size2D *size = eina_inarray_nth(arr_size, i); 37 Eina_Size2D *size = eina_inarray_nth(arr_size, i);
38 38
39 sizes[i - start_id].size = *size; 39 sizes[i - conf.range.start_id].size = *size;
40 sizes[i - start_id].group = 0; 40 sizes[i - conf.range.start_id].depth_leader = 0;
41 sizes[i - conf.range.start_id].element_depth = 0;
41 } 42 }
42 result.filled_items = i - start_id; 43 result.filled_items = i - conf.range.start_id;
43 result.group_id = -1; 44 result.parent_size = EINA_SIZE2D(0, 0);
44 return result; 45 return result;
45} 46}
46 47
47static Efl_Ui_Position_Manager_Batch_Result 48static Efl_Ui_Position_Manager_Object_Batch_Result
48_obj_accessor_get_at(void *data EINA_UNUSED, int start_id, Eina_Rw_Slice memory) 49_obj_accessor_get_at(void *data EINA_UNUSED, Efl_Ui_Position_Manager_Request_Range range, Eina_Rw_Slice memory)
49{ 50{
50 int i; 51 int i;
51 Efl_Ui_Position_Manager_Batch_Entity_Access *objs = memory.mem; 52 Efl_Ui_Position_Manager_Object_Batch_Entity *objs = memory.mem;
52 Efl_Ui_Position_Manager_Batch_Result result; 53 Efl_Ui_Position_Manager_Object_Batch_Result result;
53 54
54 for (i = start_id; i < (int)(MIN(start_id + memory.len, eina_array_count(arr_obj))); ++i) 55 for (i = range.start_id; i < (int)(MIN(range.end_id, eina_array_count(arr_obj))); ++i)
55 { 56 {
56 Efl_Gfx_Entity *geom = eina_array_data_get(arr_obj, i); 57 Efl_Gfx_Entity *geom = eina_array_data_get(arr_obj, i);
57 58
58 objs[i - start_id].entity = geom; 59 objs[i - range.start_id].entity = geom;
59 objs[i - start_id].group = 0; 60 objs[i - range.start_id].depth_leader = 0;
61 objs[i - range.start_id].element_depth = 0;
60 } 62 }
61 result.filled_items = i - start_id; 63 result.filled_items = i - range.start_id;
62 result.group_id = -1; 64 result.group = NULL;
63 return result; 65 return result;
64} 66}
65static void 67static void
@@ -68,7 +70,7 @@ _initial_setup(void)
68 arr_obj = eina_array_new(10); 70 arr_obj = eina_array_new(10);
69 arr_size = eina_inarray_new(sizeof(Eina_Size2D), 10); 71 arr_size = eina_inarray_new(sizeof(Eina_Size2D), 10);
70 72
71 efl_ui_position_manager_entity_data_access_set(position_manager, 73 efl_ui_position_manager_data_access_v1_data_access_set(position_manager,
72 NULL, _obj_accessor_get_at, NULL, 74 NULL, _obj_accessor_get_at, NULL,
73 NULL, _size_accessor_get_at, NULL, 75 NULL, _size_accessor_get_at, NULL,
74 0); 76 0);