jpeg pushed a commit to branch efl-1.14.

http://git.enlightenment.org/core/efl.git/commit/?id=fa2d290a6a681e474709edce10baa74f993f523f

commit fa2d290a6a681e474709edce10baa74f993f523f
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Fri Jun 12 15:44:31 2015 +0900

    Evas filters: Fix blend with color with rgba buffers
    
    - blend { color = red }
    - blur { color = red }
    were not working with RGBA input. This patch fixes that.
    
    @fix
---
 src/lib/evas/filters/evas_filter.c       |  3 ++-
 src/lib/evas/filters/evas_filter_blend.c | 14 +++++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 45db315..0f24870 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -940,7 +940,8 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void 
*drawctx,
         ERR("Input is RGBA but output is Alpha only. Unsupported config for 
blur.");
         goto fail;
      }
-   else if (blend || (in->alpha_only && !out->alpha_only))
+   else if ((blend || (in->alpha_only && !out->alpha_only)) ||
+            (!blend && !in->alpha_only && !out->alpha_only && (color != 
0xFFFFFFFF)))
      {
         DBG("Adding extra blending step %d --> %d (%s --> %s)", in->id, 
out->id,
             in->alpha_only ? "Alpha" : "RGBA",
diff --git a/src/lib/evas/filters/evas_filter_blend.c 
b/src/lib/evas/filters/evas_filter_blend.c
index 4c90a92..6c05fe3 100644
--- a/src/lib/evas/filters/evas_filter_blend.c
+++ b/src/lib/evas/filters/evas_filter_blend.c
@@ -208,7 +208,12 @@ _image_draw_cpu_rgba2rgba(void *data EINA_UNUSED, void 
*context,
 
    EINA_SAFETY_ON_FALSE_RETURN_VAL((src_w == dst_w) && (src_h == dst_h), 
EINA_FALSE);
 
-   func = 
evas_common_gfx_func_composite_pixel_span_get(src->cache_entry.flags.alpha, 
src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, 1, 
dc->render_op);
+   if (!dc->color)
+     return EINA_TRUE;
+   else if (dc->color == 0xFFFFFFFF)
+     func = 
evas_common_gfx_func_composite_pixel_span_get(src->cache_entry.flags.alpha, 
src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, 1, 
dc->render_op);
+   else
+     func = 
evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha,
 src->cache_entry.flags.alpha_sparse, dc->color, dst->cache_entry.flags.alpha, 
1, dc->render_op);
    EINA_SAFETY_ON_NULL_RETURN_VAL(func, EINA_FALSE);
 
    sw = src->cache_entry.w;
@@ -276,8 +281,11 @@ _filter_blend_cpu_rgba(Evas_Filter_Command *cmd)
      return EINA_TRUE;
 
    drawctx = cmd->ENFN->context_new(cmd->ENDT);
-   cmd->ENFN->context_color_set(cmd->ENDT, drawctx, cmd->draw.R, cmd->draw.G,
-                                cmd->draw.B, cmd->draw.A);
+   cmd->ENFN->context_color_set(cmd->ENDT, drawctx, 255, 255, 255, 255);
+   if ((cmd->draw.R != 255) || (cmd->draw.G != 255) || (cmd->draw.B != 255) || 
(cmd->draw.A != 255))
+     cmd->ENFN->context_multiplier_set(cmd->ENDT, drawctx, cmd->draw.R, 
cmd->draw.G, cmd->draw.B, cmd->draw.A);
+   else
+     cmd->ENFN->context_multiplier_unset(cmd->ENDT, drawctx);
    cmd->ENFN->context_render_op_set(cmd->ENDT, drawctx, cmd->draw.render_op);
 
    if (cmd->draw.clip_use)

-- 


Reply via email to