From 16c2622bb47147dfeb59faeebc201938e959a80a Mon Sep 17 00:00:00 2001 From: hermet Date: Wed, 16 May 2012 12:59:33 +0000 Subject: [PATCH] evas/evas_render - added evas_object_change_reset internal function to remove much duplicated code git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@71169 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_main.c | 11 +++++++ src/lib/canvas/evas_render.c | 68 +++++---------------------------------- src/lib/include/evas_private.h | 1 + 3 files changed, 20 insertions(+), 60 deletions(-) diff --git a/src/lib/canvas/evas_object_main.c b/src/lib/canvas/evas_object_main.c index a0b9ad7..d9ef9ee 100644 --- a/src/lib/canvas/evas_object_main.c +++ b/src/lib/canvas/evas_object_main.c @@ -31,6 +31,17 @@ evas_object_new(Evas *e __UNUSED__) } void +evas_object_change_reset(Evas_Object *obj) +{ + obj->changed = EINA_FALSE; + obj->changed_move_only = EINA_FALSE; + obj->changed_nomove = EINA_FALSE; + obj->changed_move = EINA_FALSE; + obj->changed_map = EINA_FALSE; + obj->changed_pchange = EINA_FALSE; +} + +void evas_object_free(Evas_Object *obj, int clean_layer) { int was_smart_child = 0; diff --git a/src/lib/canvas/evas_render.c b/src/lib/canvas/evas_render.c index 87f1657..521781a 100644 --- a/src/lib/canvas/evas_render.c +++ b/src/lib/canvas/evas_render.c @@ -595,33 +595,12 @@ pending_change(void *data, void *gdata __UNUSED__) { RD(" OBJ [%p] pending change %i -> 0, pre %i\n", obj, obj->changed, obj->pre_render_done); obj->pre_render_done = 0; - //// FIXME: this wipes out changes - obj->changed = 0; - obj->changed_move_only = 0; - obj->changed_nomove = 0; - obj->changed_move = 0; - obj->changed_map = 0; - obj->changed_pchange = 0; + evas_object_change_reset(obj); } return obj->changed ? EINA_TRUE : EINA_FALSE; } -/* - static void - unchange(Evas_Object *obj) - { - Evas_Object *obj2; - - if (!obj->changed) return; - obj->changed = 0; - obj->changed_move_only = 0; - obj->changed_nomove = 0; - obj->changed_move = 0; - EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2) - { - unchange(obj2); - } - } +/* static int chlist(Evas_Object *obj, int i) { @@ -970,34 +949,18 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, if (!evas_object_is_visible(o2) && !evas_object_was_visible(o2)) { - o2->changed = 0; - o2->changed_move_only = 0; - o2->changed_nomove = 0; - o2->changed_move = 0; - o2->changed_map = 0; - o2->changed_pchange = 0; + evas_object_change_reset(o2); continue; } if (o2->changed) { // chlist(o2, 0); changed = 1; - o2->changed = 0; - o2->changed_move_only = 0; - o2->changed_nomove = 0; - o2->changed_move = 0; - o2->changed_map = 0; - o2->changed_pchange = 0; + evas_object_change_reset(o2); break; } } - // unchange(obj); - obj->changed = 0; - obj->changed_move_only = 0; - obj->changed_nomove = 0; - obj->changed_move = 0; - obj->changed_map = 0; - obj->changed_pchange = 0; + evas_object_change_reset(obj); } else { @@ -1005,12 +968,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, { if ((obj->changed_pchange) && (obj->changed_map)) changed = 1; - obj->changed = 0; - obj->changed_move_only = 0; - obj->changed_nomove = 0; - obj->changed_move = 0; - obj->changed_map = 0; - obj->changed_pchange = 0; + evas_object_change_reset(obj); } } @@ -1640,12 +1598,7 @@ evas_render_updates_internal(Evas *e, RD(" OBJ [%p] post... func1\n", obj); obj->func->render_post(obj); obj->restack = 0; - obj->changed = 0; - obj->changed_move_only = 0; - obj->changed_nomove = 0; - obj->changed_move = 0; - obj->changed_map = 0; - obj->changed_pchange = 0; + evas_object_change_reset(obj); } else if ((obj->cur.map != obj->prev.map) || (obj->cur.usemap != obj->prev.usemap)) @@ -1653,12 +1606,7 @@ evas_render_updates_internal(Evas *e, RD(" OBJ [%p] post... func2\n", obj); obj->func->render_post(obj); obj->restack = 0; - obj->changed = 0; - obj->changed_move_only = 0; - obj->changed_nomove = 0; - obj->changed_move = 0; - obj->changed_map = 0; - obj->changed_pchange = 0; + evas_object_change_reset(obj); } /* moved to other pre-process phase 1 if (obj->delete_me == 2) diff --git a/src/lib/include/evas_private.h b/src/lib/include/evas_private.h index bf0cfc5..b21d59b 100644 --- a/src/lib/include/evas_private.h +++ b/src/lib/include/evas_private.h @@ -888,6 +888,7 @@ extern "C" { #endif Evas_Object *evas_object_new(Evas *e); +void evas_object_change_reset(Evas_Object *obj); void evas_object_free(Evas_Object *obj, int clean_layer); void evas_object_inject(Evas_Object *obj, Evas *e); void evas_object_release(Evas_Object *obj, int clean_layer); -- 2.7.4