jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=83746e56298337daa856524d30643c9d417bd437
commit 83746e56298337daa856524d30643c9d417bd437 Author: Jean-Philippe ANDRE <[email protected]> Date: Sun Mar 2 19:08:22 2014 +0900 Evas filters: fix black squares with the GL engine If a text object changes regularily, there might be cases where the object will be rendered as a simple black rectangle for just one frame. It seems that the previous output buffer is deleted before being actually rendered on screen. This patch will delay the deletion of the previous buffer until the current one has been rendered to the target surface. And again, thanks zmike for reporting. @fix Signed-off-by: Jean-Philippe Andre <[email protected]> --- src/lib/evas/canvas/evas_object_text.c | 2 +- src/lib/evas/filters/evas_filter.c | 13 ++++++++++++- src/lib/evas/filters/evas_filter_private.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index e99ab4b..bc11ae8 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -2217,7 +2217,7 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED, // Proxies evas_filter_context_proxy_render_all(filter, eo_obj, EINA_FALSE); - // Context: FIXME it should be a sw context only + // Draw Context filter_ctx = ENFN->context_new(ENDT); ENFN->context_color_set(ENDT, filter_ctx, 255, 255, 255, 255); diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index b3385ba..97b3ea1 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -681,7 +681,8 @@ evas_filter_buffer_backing_release(Evas_Filter_Context *ctx, void *stolen_buffer if (ctx->async) evas_unref_queue_image_put(ctx->evas, ie); else if (ctx->gl_engine) - ENFN->image_free(ENDT, stolen_buffer); + ctx->post_run.buffers_to_free = + eina_list_append(ctx->post_run.buffers_to_free, stolen_buffer); else _backing_free(ctx, ie); @@ -1691,7 +1692,17 @@ static void _filter_thread_run_cb(void *data) { Evas_Filter_Context *ctx = data; + void *buffer; + + // TODO: Add return value check and call error cb _filter_chain_run(ctx); + + EINA_LIST_FREE(ctx->post_run.buffers_to_free, buffer) + { + if (ctx->gl_engine) + ENFN->image_free(ENDT, buffer); + } + if (ctx->post_run.cb) ctx->post_run.cb(ctx, ctx->post_run.data); } diff --git a/src/lib/evas/filters/evas_filter_private.h b/src/lib/evas/filters/evas_filter_private.h index 5ce6218..c747058 100644 --- a/src/lib/evas/filters/evas_filter_private.h +++ b/src/lib/evas/filters/evas_filter_private.h @@ -55,6 +55,7 @@ struct _Evas_Filter_Context /** Post-processing callback. The context can be safely destroyed here. */ Evas_Filter_Cb cb; void *data; + Eina_List *buffers_to_free; // Some buffers should be queued for deletion } post_run; struct --
