This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efl.
View the commit online.
commit b9d2e28f412c139d7a2ae7a1aab1df9be5288483
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 28 14:09:41 2026 -0600
evas/filters: do not log errors for valid filters
A program which never reads its input failed a safety check on every
render, having no input buffer to draw into. Setting a source before
the program ran the parser on no program.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/lib/evas/canvas/evas_filter_mixin.c | 21 ++++++++++++++-------
src/lib/evas/filters/evas_filter.c | 9 +++++++++
src/lib/evas/include/evas_filter.h | 1 +
3 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c
index ce60a7ed54..d363c4dd34 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -445,9 +445,12 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
// Request rendering from the object itself (child class)
evas_filter_program_padding_get(pd->data->chain, &pad, NULL);
- ok = evas_filter_input_render(eo_obj, filter, engine, output, drawctx, NULL,
- pad.l, pad.r, pad.t, pad.b, 0, 0, do_async);
- if (!ok) ERR("Filter input render failed.");
+ if (evas_filter_context_input_used(filter))
+ {
+ ok = evas_filter_input_render(eo_obj, filter, engine, output, drawctx, NULL,
+ pad.l, pad.r, pad.t, pad.b, 0, 0, do_async);
+ if (!ok) ERR("Filter input render failed.");
+ }
ENFN->context_free(engine, drawctx);
@@ -603,10 +606,14 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_source_set(Eo *eo_obj, Evas_Fi
}
eina_hash_add(fcow->sources, pb->name, pb);
- evas_filter_program_source_set_all(fcow->chain, fcow->sources);
- evas_filter_program_data_set_all(fcow->chain, fcow->data);
- invalid = !evas_filter_program_parse(fcow->chain, fcow->code);
- if (!invalid) evas_filter_program_padding_get(fcow->chain, NULL, &fcow->padding);
+ /* without a program yet, the source waits for one */
+ if (fcow->chain)
+ {
+ evas_filter_program_source_set_all(fcow->chain, fcow->sources);
+ evas_filter_program_data_set_all(fcow->chain, fcow->data);
+ invalid = !evas_filter_program_parse(fcow->chain, fcow->code);
+ if (!invalid) evas_filter_program_padding_get(fcow->chain, NULL, &fcow->padding);
+ }
// Update object
update:
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index de34e09b25..2278b8eaf0 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -574,6 +574,13 @@ _filter_buffer_get(Evas_Filter_Context *ctx, int bufid)
return NULL;
}
+/* A program which never reads its input gets no buffer for it */
+Eina_Bool
+evas_filter_context_input_used(Evas_Filter_Context *ctx)
+{
+ return !!_filter_buffer_get(ctx, EVAS_FILTER_BUFFER_INPUT_ID);
+}
+
void *
evas_filter_buffer_backing_get(Evas_Filter_Context *ctx, int bufid, Eina_Bool render)
{
@@ -1845,6 +1852,8 @@ evas_filter_font_draw(Evas_Filter_Context *ctx,
int R, G, B, A;
fb = _filter_buffer_get(ctx, bufid);
+ /* nothing to draw for a program which does not read its input */
+ if (!fb && (bufid == EVAS_FILTER_BUFFER_INPUT_ID)) return EINA_TRUE;
EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE);
surface = evas_filter_buffer_backing_get(ctx, bufid, EINA_TRUE);
diff --git a/src/lib/evas/include/evas_filter.h b/src/lib/evas/include/evas_filter.h
index e70e664fd0..3cd50f94d2 100644
--- a/src/lib/evas/include/evas_filter.h
+++ b/src/lib/evas/include/evas_filter.h
@@ -130,6 +130,7 @@ Evas_Filter_Context *evas_filter_context_new(Evas_Public_Data *evas, Eina_Bo
void *evas_filter_context_data_get(Evas_Filter_Context *ctx);
Eina_Bool evas_filter_context_async_get(Evas_Filter_Context *ctx);
Eina_Bool evas_filter_context_gl_get(const Evas_Filter_Context *ctx);
+Eina_Bool evas_filter_context_input_used(Evas_Filter_Context *ctx);
void evas_filter_context_size_get(Evas_Filter_Context *ctx, int *w, int *H);
int evas_filter_context_ref(Evas_Filter_Context *ctx);
void evas_filter_context_unref(Evas_Filter_Context *ctx);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.