aboutsummaryrefslogtreecommitdiffstats
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
parentefl_ui : rename model connect and factory connect to bind property and factory. (diff)
downloadefl-4ff180ac6a9d2b5912cf64cb02270f88c81b738f.tar.gz
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 https://phab.enlightenment.org/D7852 Reviewers: devilhorns, cedric Reviewed By: devilhorns, cedric Subscribers: devilhorns, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7853
-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)
efl_canvas_group_member_add(smart_obj, eo_obj);
}
+static void
+_evas_object_smart_member_cache_invalidate(Evas_Object_Protected_Data *obj, Evas_Smart_Data *sd)
+{
+ Evas_Object_Protected_Data *member;
+ Evas_Smart_Data *msd;
+
+ obj->parent_cache.pass_events_valid = EINA_FALSE;
+ obj->parent_cache.freeze_events_valid = EINA_FALSE;
+ obj->parent_cache.src_invisible_valid = EINA_FALSE;
+ if (!sd) return;
+
+ EINA_INLIST_FOREACH(sd->contained, member)
+ {
+ if (member->is_smart)
+ msd = efl_data_scope_get(member->object, MY_CLASS);
+ else msd = NULL;
+ _evas_object_smart_member_cache_invalidate(member, msd);
+ }
+}
+
EOLIAN static void
_efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo_obj)
{
@@ -267,14 +287,13 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec
obj->smart.parent_data = o;
obj->smart.parent_object_data = smart;
o->contained = eina_inlist_append(o->contained, EINA_INLIST_GET(obj));
- evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_TRUE,
- EINA_TRUE);
+
+ if (obj->is_smart) member_o = efl_data_scope_get(eo_obj, MY_CLASS);
+ _evas_object_smart_member_cache_invalidate(obj, member_o);
obj->restack = 1;
if (obj->is_smart)
{
- member_o = efl_data_scope_get(eo_obj, MY_CLASS);
-
if ((member_o->inherit_paragraph_direction) &&
(member_o->paragraph_direction != o->paragraph_direction))
{
@@ -331,7 +350,7 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS
{
Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
Evas_Object_Protected_Data *smart;
- Evas_Smart_Data *member_o, *o;
+ Evas_Smart_Data *member_o = NULL, *o;
if (!obj || !obj->smart.parent) return;
@@ -356,7 +375,9 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS
o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(obj));
o->member_count--;
obj->smart.parent = NULL;
- evas_object_smart_member_cache_invalidate(eo_obj, EINA_TRUE, EINA_TRUE, EINA_TRUE);
+
+ if (obj->is_smart) member_o = efl_data_scope_get(eo_obj, MY_CLASS);
+ _evas_object_smart_member_cache_invalidate(obj, member_o);
if (obj->layer->layer != obj->cur->layer)
{
@@ -367,8 +388,6 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS
if (obj->is_smart)
{
- member_o = efl_data_scope_get(eo_obj, MY_CLASS);
-
if ((member_o->inherit_paragraph_direction) &&
(member_o->paragraph_direction != EVAS_BIDI_DIRECTION_NEUTRAL))
{