From b045feefb1d61e682322acfecd18469a64b3c1b4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 25 Mar 2014 15:57:01 +0900 Subject: [PATCH] Evas filters: Fix blur with src == dst If dst == src, then we should not blend back to the buffer, as we actually want to blur the content and not keep the sharp version. --- src/lib/evas/filters/evas_filter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index 0c6c40f516..dec5149677 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -851,7 +851,7 @@ evas_filter_temporary_buffer_get(Evas_Filter_Context *ctx, int w, int h, buf = _buffer_new(ctx, w, h, alpha_only); buf->locked = EINA_TRUE; - DBG("Created temporary buffer: %d", buf->id); + DBG("Created temporary buffer: %d (%s)", buf->id, alpha_only ? "Alpha" : "RGBA"); return buf; } @@ -934,6 +934,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx, goto fail; } + if (in == out) out->dirty = EINA_FALSE; blend = (out->dirty && !out->transient); switch (type) @@ -1017,7 +1018,9 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx, } else if (blend || (in->alpha_only && !out->alpha_only)) { - DBG("Adding extra blending step (%s --> RGBA)", in->alpha_only ? "Alpha" : "RGBA"); + DBG("Adding extra blending step %d --> %d (%s --> %s)", in->id, out->id, + in->alpha_only ? "Alpha" : "RGBA", + out->alpha_only ? "Alpha" : "RGBA"); blur_out = evas_filter_temporary_buffer_get(ctx, 0, 0, in->alpha_only); if (!blur_out) goto fail; blend = EINA_TRUE;