From e05885e0e3a54d5e0b9177645238835766d8cca1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Mon, 3 Mar 2014 16:58:18 +0900 Subject: [PATCH] Evas filters: Fallback to normal rendering in case of error If the filters fail to render at runtime (that is, parsing went fine but a command failed to run properly), fallback to normal rendering. This should prevent text from disappearing when using proxies and the OpenGL engine (for now). --- src/lib/evas/canvas/evas_object_text.c | 17 +++++++++++++---- src/lib/evas/filters/evas_filter.c | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index bc11ae8bdf..00312182e5 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -2130,7 +2130,7 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED, * remotely similar to its final form. You've been warned :) */ - if (o->cur.filter.chain || (o->cur.filter.code && !o->cur.filter.invalid)) + if (!o->cur.filter.invalid && (o->cur.filter.chain || o->cur.filter.invalid)) { int X, Y, W, H; Evas_Filter_Context *filter; @@ -2245,11 +2245,20 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED, // Add post-run callback and run filter evas_filter_context_autodestroy(filter); - evas_filter_run(filter); + ok = evas_filter_run(filter); o->cur.filter.changed = EINA_FALSE; - DBG("Effect rendering done."); - return; + if (ok) + { + DBG("Effect rendering done."); + return; + } + else + { + ERR("Rendering failed"); + o->cur.filter.invalid = EINA_TRUE; + goto normal_render; + } } /* End of the EXPERIMENTAL code */ diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index 894f8effa2..2dce45c17d 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -1687,7 +1687,7 @@ static Eina_Bool _filter_chain_run(Evas_Filter_Context *ctx) { Evas_Filter_Command *cmd; - Eina_Bool ok = EINA_TRUE; + Eina_Bool ok = EINA_FALSE; ctx->running = EINA_TRUE; EINA_INLIST_FOREACH(ctx->commands, cmd)