From 4778a84824d4c059453d9ba1a4b0c912eeb54143 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 12 Jul 2018 09:14:32 -0400 Subject: [PATCH] canvas render: stop render_pre/post cb if it didn't render. Summary: Basically, render_pre/post should be called only if rendering happens. Unfortunately, this behavior had been broken by some mistakes. As far as I understand after reading history carefully, this issue introduced for fixing unpair of pre/post cbs. In case of async render, the post callback would be triggered in evas_render_pipe_wakeup(), it means POST callbake shouldn't be tiggered in evas_render_updates_internal(). If that post callback were removed in evas_render_updates_internal(), then in case of sync_render, POST callback won't be triggered. So previously, the PRE/POST couldn't get paired. I guess cedric put a mistake that nothing2rendering which brought the pre/post pair issue, even he said that patch fix the unpair of them. (But actually that patch brought the issue!) See this: dc841ed9b2ccf880df2d7590ea46d95e03e8752f Whatever it was intented or not, that patch totally insane, even non-descripting. If we just trigger post cb only if sync render or no_rendered case, We could make satisfication for both cases. @fix Reviewers: #committers, devilhorns, zmike Reviewed By: #committers, zmike Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6573 --- src/lib/evas/canvas/evas_render.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 3256ae1185..f03a6a5cab 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -3171,11 +3171,7 @@ evas_render_updates_internal(Evas *eo_e, e = evas = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); if (e->inside_post_render) return EINA_FALSE; - if (!e->changed) - { - _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL); - goto nothing2render; - } + if (!e->changed) return EINA_FALSE; if (e->rendering) { @@ -3707,14 +3703,14 @@ evas_render_updates_internal(Evas *eo_e, evas_module_clean(); - // Send a RENDER_POST when we are rendering synchronously or when there is no update done asynchronously + /* Send a RENDER_POST when we are rendering synchronously or, + when do_async but no drawing. This gurantees pre-post pair. */ if (!do_async || !rendering) { Evas_Event_Render_Post post; Eina_List *l1, *l2; Render_Updates *ru; - nothing2render: post.updated_area = NULL; EINA_LIST_FOREACH(e->outputs, l1, out) {