summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-12-03 16:23:05 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-12-03 16:43:58 +0900
commitf90803aa2fb2a201529cd1205702edc99bd180f6 (patch)
tree8121e7eeda5a3218ceefabb2c147a0d28a9f0599 /src
parent7cac8bceef0ddf1534f71c5d49f7906d5cd08060 (diff)
evas: bugfix in evas_render of not maintaining changed flags on object correctly.
This bug is particularly visible in EFM video preview ( T 539 ). The problem is that the logic for changed has evolved over time. At the beginning Evas canvas was flat and could be handle in an array. It was then not using the changed flag that much. This day, we are living with a tree and we need to propagate the changed flag to the parent, so that when we walk them we only need to walk the active objects and don't spend our time on branch that are completely static. Sadly things did collide here. We remove all object that have been rendered from the pending_objects array. That does include any smart object that was processed even if one of the child was not. Once any of the child of that not processed object is marked changed, it will be propagated up to the first parent that is changed. As the parent of that one are marked as not changed when evas_render walk the tree, he is blocked really early in the process and never get a chance to detect that the child of a not changed object did change and tada ! The fix is to add all the parent of all the object that are in the pending_objects array back into the pending_objects list. So they will always be marked as changed. Another alternative to this logic would have been to change pending_change to filter out those and keep them around. I choose the first solution as I think it will be more robust to catch all the parent in all case.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_render.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index b12af6b99b..d33cd42421 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -2048,6 +2048,21 @@ evas_render_updates_internal(Evas *eo_e,
2048 them from the pending list. */ 2048 them from the pending list. */
2049 eina_array_remove(&e->pending_objects, pending_change, NULL); 2049 eina_array_remove(&e->pending_objects, pending_change, NULL);
2050 2050
2051 /* Reinsert parent of changed object in the pending changed state */
2052 for (i = 0; i < e->pending_objects.count; ++i)
2053 {
2054 obj = eina_array_data_get(&e->pending_objects, i);
2055 eo_obj = obj->object;
2056 if (obj->smart.parent)
2057 {
2058 Evas_Object_Protected_Data *smart_parent;
2059
2060 smart_parent = eo_data_scope_get(obj->smart.parent,
2061 EVAS_OBJ_CLASS);
2062 evas_object_change(obj->smart.parent, smart_parent);
2063 }
2064 }
2065
2051 for (i = 0; i < e->render_objects.count; ++i) 2066 for (i = 0; i < e->render_objects.count; ++i)
2052 { 2067 {
2053 obj = eina_array_data_get(&e->render_objects, i); 2068 obj = eina_array_data_get(&e->render_objects, i);
@@ -2055,7 +2070,7 @@ evas_render_updates_internal(Evas *eo_e,
2055 obj->pre_render_done = EINA_FALSE; 2070 obj->pre_render_done = EINA_FALSE;
2056 if ((obj->changed) && (do_draw)) 2071 if ((obj->changed) && (do_draw))
2057 { 2072 {
2058 obj->func->render_post(eo_obj, obj, obj->private_data); 2073 obj->func->render_post(eo_obj, obj, obj->private_data);
2059 obj->restack = EINA_FALSE; 2074 obj->restack = EINA_FALSE;
2060 evas_object_change_reset(eo_obj); 2075 evas_object_change_reset(eo_obj);
2061 } 2076 }