From 37eb6b6233a922bd1d9aa8379cbc67a5e349b215 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 31 Dec 2013 12:43:03 +0900 Subject: [PATCH] Evas filters: Change default buffer size to input size This should make more commands work intuitively. Now we still need to specify how to repeat or stretch buffers when running commands. --- src/lib/evas/filters/evas_filter.c | 13 ++++++++++--- src/lib/evas/filters/evas_filter_private.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index fa19f0018b..9f2026066b 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -1183,10 +1183,10 @@ _filter_command_run(Evas_Filter_Command *cmd) return EINA_TRUE; } - if (!cmd->output->backing) + if (!cmd->output->backing && !cmd->output->w && !cmd->output->h) { - cmd->output->w = cmd->input->w; - cmd->output->h = cmd->input->h; + cmd->output->w = cmd->ctx->w; + cmd->output->h = cmd->ctx->h; } if ((cmd->output->w <= 0) || (cmd->output->h <= 0)) @@ -1254,6 +1254,13 @@ _filter_chain_run(Evas_Filter_Context *ctx) { Evas_Filter_Command *cmd; Eina_Bool ok = EINA_TRUE; + Evas_Filter_Buffer *in; + + in = _filter_buffer_get(ctx, 1); + EINA_SAFETY_ON_NULL_RETURN_VAL(in, EINA_FALSE); + + ctx->w = in->w; + ctx->h = in->h; EINA_INLIST_FOREACH(ctx->commands, cmd) { diff --git a/src/lib/evas/filters/evas_filter_private.h b/src/lib/evas/filters/evas_filter_private.h index f7cb109e72..95097e6584 100644 --- a/src/lib/evas/filters/evas_filter_private.h +++ b/src/lib/evas/filters/evas_filter_private.h @@ -40,6 +40,7 @@ struct _Evas_Filter_Context Eina_List *buffers; // Evas_Filter_Buffer * int last_buffer_id; int last_command_id; + int w, h; // Change at each run struct {