summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_smart.c
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2019-02-11 14:13:33 -0500
committerChristopher Michael <cp.michael@samsung.com>2019-02-11 14:13:33 -0500
commit4ff180ac6a9d2b5912cf64cb02270f88c81b738f (patch)
tree5dbf89b077edd9f29ee7443d53f709ccf6b28765 /src/lib/evas/canvas/evas_object_smart.c
parent053146598c346aa7c200aee55093a5e463d255de (diff)
evas_object_smart: Speed up some cache invalidation calls
Summary: A large number of cache invalidation calls are doing pointer indirection that is completely avoidable. Depends on D7852 Reviewers: devilhorns, cedric Reviewed By: devilhorns, cedric Subscribers: devilhorns, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7853
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index d945f53a85..a5ff430772 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -206,6 +206,26 @@ evas_object_smart_member_add(Evas_Object *eo_obj, Evas_Object *smart_obj)
206 efl_canvas_group_member_add(smart_obj, eo_obj); 206 efl_canvas_group_member_add(smart_obj, eo_obj);
207} 207}
208 208
209static void
210_evas_object_smart_member_cache_invalidate(Evas_Object_Protected_Data *obj, Evas_Smart_Data *sd)
211{
212 Evas_Object_Protected_Data *member;
213 Evas_Smart_Data *msd;
214
215 obj->parent_cache.pass_events_valid = EINA_FALSE;
216 obj->parent_cache.freeze_events_valid = EINA_FALSE;
217 obj->parent_cache.src_invisible_valid = EINA_FALSE;
218 if (!sd) return;
219
220 EINA_INLIST_FOREACH(sd->contained, member)
221 {
222 if (member->is_smart)
223 msd = efl_data_scope_get(member->object, MY_CLASS);
224 else msd = NULL;
225 _evas_object_smart_member_cache_invalidate(member, msd);
226 }
227}
228
209EOLIAN static void 229EOLIAN static void
210_efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo_obj) 230_efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo_obj)
211{ 231{
@@ -267,14 +287,13 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec
267 obj->smart.parent_data = o; 287 obj->smart.parent_data = o;
268 obj->smart.parent_object_data = smart; 288 obj->smart.parent_object_data = smart;
269 o->contained = eina_inlist_append(o->contained, EINA_INLIST_GET(obj)); 289 o->contained = eina_inlist_append(o->contained, EINA_INLIST_GET(obj));
270 evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_TRUE, 290
271 EINA_TRUE); 291 if (obj->is_smart) member_o = efl_data_scope_get(eo_obj, MY_CLASS);
292 _evas_object_smart_member_cache_invalidate(obj, member_o);
272 obj->restack = 1; 293 obj->restack = 1;
273 294
274 if (obj->is_smart) 295 if (obj->is_smart)
275 { 296 {
276 member_o = efl_data_scope_get(eo_obj, MY_CLASS);
277
278 if ((member_o->inherit_paragraph_direction) && 297 if ((member_o->inherit_paragraph_direction) &&
279 (member_o->paragraph_direction != o->paragraph_direction)) 298 (member_o->paragraph_direction != o->paragraph_direction))
280 { 299 {
@@ -331,7 +350,7 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS
331{ 350{
332 Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 351 Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
333 Evas_Object_Protected_Data *smart; 352 Evas_Object_Protected_Data *smart;
334 Evas_Smart_Data *member_o, *o; 353 Evas_Smart_Data *member_o = NULL, *o;
335 354
336 if (!obj || !obj->smart.parent) return; 355 if (!obj || !obj->smart.parent) return;
337 356
@@ -356,7 +375,9 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS
356 o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(obj)); 375 o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(obj));
357 o->member_count--; 376 o->member_count--;
358 obj->smart.parent = NULL; 377 obj->smart.parent = NULL;
359 evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_TRUE, EINA_TRUE); 378
379 if (obj->is_smart) member_o = efl_data_scope_get(eo_obj, MY_CLASS);
380 _evas_object_smart_member_cache_invalidate(obj, member_o);
360 381
361 if (obj->layer->layer != obj->cur->layer) 382 if (obj->layer->layer != obj->cur->layer)
362 { 383 {
@@ -367,8 +388,6 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS
367 388
368 if (obj->is_smart) 389 if (obj->is_smart)
369 { 390 {
370 member_o = efl_data_scope_get(eo_obj, MY_CLASS);
371
372 if ((member_o->inherit_paragraph_direction) && 391 if ((member_o->inherit_paragraph_direction) &&
373 (member_o->paragraph_direction != EVAS_BIDI_DIRECTION_NEUTRAL)) 392 (member_o->paragraph_direction != EVAS_BIDI_DIRECTION_NEUTRAL))
374 { 393 {