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 <jp.andre@samsung.com>
This commit is contained in:
Jean-Philippe ANDRE 2014-03-02 19:08:22 +09:00 committed by Jean-Philippe Andre
parent 7f63b4a3eb
commit 83746e5629
3 changed files with 14 additions and 2 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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