summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2020-05-19 13:14:29 +0900
committerHermet Park <chuneon.park@samsung.com>2020-05-19 13:14:30 +0900
commit7b21b6fb97aa7c069ab378b6af81bc96a6842d9b (patch)
treecfabc95fe89f424d34ad81ff05c84025ae9f22be
parent633202a0f93661d35a340dae692208dfcc792a41 (diff)
evas: do not call evas_object_change in reneder_post
Summary: evas_render_updates_internal > eina_array_remove is calling pending_change pending_change > render_post could call evas_object_change > evas_render_object_recalc. The eina_array is removing its item from pending_objects, while the evas_object_change that is calling evas_render_object_recalc is adding item to pending_objects. As a result, the pending_objects.count is incorrect, and it breaks render. Reviewers: Hermet, jsuya, herb Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11835
-rw-r--r--src/lib/evas/canvas/evas_main.c2
-rw-r--r--src/lib/evas/canvas/evas_object_image.c2
-rw-r--r--src/lib/evas/canvas/evas_render.c19
-rw-r--r--src/lib/evas/include/evas_private.h2
4 files changed, 24 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 956e13dbcf..b6eab9f411 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -363,6 +363,7 @@ _evas_canvas_efl_object_constructor(Eo *eo_obj, Evas_Public_Data *e)
363 EVAS_ARRAY_SET(e, glyph_unref_queue); 363 EVAS_ARRAY_SET(e, glyph_unref_queue);
364 EVAS_ARRAY_SET(e, texts_unref_queue); 364 EVAS_ARRAY_SET(e, texts_unref_queue);
365 365
366 eina_array_step_set(&e->render_post_change_objects, sizeof(e->render_post_change_objects), 10);
366 eina_array_step_set(&e->map_clip_objects, sizeof(e->map_clip_objects), 64); 367 eina_array_step_set(&e->map_clip_objects, sizeof(e->map_clip_objects), 64);
367 368
368 e->active_objects.version = EINA_ARRAY_VERSION; 369 e->active_objects.version = EINA_ARRAY_VERSION;
@@ -648,6 +649,7 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
648 eina_array_flush(&e->texts_unref_queue); 649 eina_array_flush(&e->texts_unref_queue);
649 eina_array_flush(&e->map_clip_objects); 650 eina_array_flush(&e->map_clip_objects);
650 eina_hash_free(e->focused_objects); 651 eina_hash_free(e->focused_objects);
652 eina_array_flush(&e->render_post_change_objects);
651 653
652 SLKL(e->post_render.lock); 654 SLKL(e->post_render.lock);
653 EINA_INLIST_FREE(e->post_render.jobs, job) 655 EINA_INLIST_FREE(e->post_render.jobs, job)
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index cad6291286..958fabaf00 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -3256,7 +3256,7 @@ evas_object_image_render_post(Evas_Object *eo_obj EINA_UNUSED,
3256 /* FIXME: copy strings across */ 3256 /* FIXME: copy strings across */
3257 3257
3258 //Somehow(preloading cancelled) image has been changed, need to redraw. 3258 //Somehow(preloading cancelled) image has been changed, need to redraw.
3259 if (o->changed) evas_object_change(eo_obj, obj); 3259 if (o->changed) evas_render_post_change_object_push(obj);
3260} 3260}
3261 3261
3262static void * 3262static void *
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 1d47ba06af..139e292ad3 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -3761,6 +3761,14 @@ evas_render_updates_internal(Evas *eo_e,
3761 } 3761 }
3762 eina_evlog("-render_post_reset", eo_e, 0.0, NULL); 3762 eina_evlog("-render_post_reset", eo_e, 0.0, NULL);
3763 3763
3764 for (i = 0; i < e->render_post_change_objects.count; ++i)
3765 {
3766 obj = eina_array_data_get(&e->render_post_change_objects, i);
3767 eo_obj = obj->object;
3768 evas_object_change(eo_obj, obj);
3769 }
3770 OBJS_ARRAY_CLEAN(&e->render_post_change_objects);
3771
3764 eina_evlog("+render_end", eo_e, 0.0, NULL); 3772 eina_evlog("+render_end", eo_e, 0.0, NULL);
3765 e->changed = EINA_FALSE; 3773 e->changed = EINA_FALSE;
3766 e->viewport.changed = EINA_FALSE; 3774 e->viewport.changed = EINA_FALSE;
@@ -4327,5 +4335,16 @@ evas_post_render_job_add(Evas_Public_Data *pd, void (*func)(void *), void *data)
4327 SLKU(pd->post_render.lock); 4335 SLKU(pd->post_render.lock);
4328} 4336}
4329 4337
4338void
4339evas_render_post_change_object_push(Evas_Object_Protected_Data *obj)
4340{
4341 Evas_Public_Data *e;
4342
4343 if (!obj || !obj->layer || !obj->layer->evas) return;
4344
4345 e = obj->layer->evas;
4346 OBJ_ARRAY_PUSH(&e->render_post_change_objects, obj);
4347}
4348
4330/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 4349/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
4331 4350
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 3a24821dd2..6d00cd7a21 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -455,6 +455,7 @@ struct _Evas_Public_Data
455 Eina_Array texts_unref_queue; 455 Eina_Array texts_unref_queue;
456 Eina_Array map_clip_objects; 456 Eina_Array map_clip_objects;
457 Eina_List *finalize_objects; 457 Eina_List *finalize_objects;
458 Eina_Array render_post_change_objects;
458 459
459 struct { 460 struct {
460 Evas_Post_Render_Job *jobs; 461 Evas_Post_Render_Job *jobs;
@@ -1283,6 +1284,7 @@ void evas_unref_queue_image_put(Evas_Public_Data *pd, void *image);
1283void evas_unref_queue_glyph_put(Evas_Public_Data *pd, void *glyph); 1284void evas_unref_queue_glyph_put(Evas_Public_Data *pd, void *glyph);
1284void evas_unref_queue_texts_put(Evas_Public_Data *pd, void *glyph); 1285void evas_unref_queue_texts_put(Evas_Public_Data *pd, void *glyph);
1285void evas_post_render_job_add(Evas_Public_Data *pd, void (*func)(void *), void *data); 1286void evas_post_render_job_add(Evas_Public_Data *pd, void (*func)(void *), void *data);
1287void evas_render_post_change_object_push(Evas_Object_Protected_Data *obj);
1286 1288
1287void evas_draw_image_map_async_check(Evas_Object_Protected_Data *obj, 1289void evas_draw_image_map_async_check(Evas_Object_Protected_Data *obj,
1288 void *engine, void *data, void *context, void *surface, 1290 void *engine, void *data, void *context, void *surface,