aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe ANDRE <jpeg@videolan.org>2014-03-02 19:08:22 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-03-04 11:12:28 +0900
commit3e65e6d4dd0f15be1bf0903a31009943e6e69798 (patch)
tree938bceeeb8d4ba2856cc67c4fd368a137dd57fa7
parentecore_avahi: @fix timeout to avoid pitfall of forever frozen timer. (diff)
downloadefl-3e65e6d4dd0f15be1bf0903a31009943e6e69798.tar.gz
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>
-rw-r--r--src/lib/evas/canvas/evas_object_text.c2
-rw-r--r--src/lib/evas/filters/evas_filter.c13
-rw-r--r--src/lib/evas/filters/evas_filter_private.h1
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 e99ab4befb..bc11ae8bdf 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 4c2d9dd010..316f88b2b8 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -680,7 +680,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);
@@ -1690,7 +1691,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 544d76717c..baf53c27ed 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