jpeg pushed a commit to branch master.

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

commit 27d97110cca5f15cebbc9a05f610bb0275fbab4b
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Mar 25 15:19:21 2014 +0900

    Evas filters: Default mask fillmode should be repeat
    
    Fillmode "NONE" has basically no practical use and shouldn't be
    the default.
---
 src/lib/evas/filters/evas_filter_mask.c   | 16 ++++++++++++++++
 src/lib/evas/filters/evas_filter_parser.c |  7 ++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter_mask.c 
b/src/lib/evas/filters/evas_filter_mask.c
index 5850071..b12e381 100644
--- a/src/lib/evas/filters/evas_filter_mask.c
+++ b/src/lib/evas/filters/evas_filter_mask.c
@@ -350,6 +350,7 @@ static Eina_Bool
 _mask_cpu_rgba_rgba_rgba(Evas_Filter_Command *cmd)
 {
    Evas_Filter_Command fake_cmd;
+   Evas_Filter_Fill_Mode fillmode;
    Evas_Filter_Apply_Func blend;
    Evas_Filter_Buffer *fb;
    Eina_Bool ret;
@@ -373,11 +374,25 @@ _mask_cpu_rgba_rgba_rgba(Evas_Filter_Command *cmd)
    EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE);
    fb->locked = EINA_TRUE;
 
+   // Repeat mask if unspecified - NONE is not possible
+   fillmode = cmd->draw.fillmode;
+   if ((fillmode & (EVAS_FILTER_FILL_MODE_REPEAT_X | 
EVAS_FILTER_FILL_MODE_STRETCH_X)) == 0)
+     {
+        DBG("X fillmode not specified: defaults to repeat");
+        fillmode |= EVAS_FILTER_FILL_MODE_REPEAT_X;
+     }
+   if ((fillmode & (EVAS_FILTER_FILL_MODE_REPEAT_Y | 
EVAS_FILTER_FILL_MODE_STRETCH_Y)) == 0)
+     {
+        DBG("Y fillmode not specified: defaults to repeat");
+        fillmode |= EVAS_FILTER_FILL_MODE_REPEAT_Y;
+     }
+
    // Mask --> Temp
    fake_cmd.input = cmd->mask;
    fake_cmd.mask = NULL;
    fake_cmd.output = fb;
    fake_cmd.draw.render_op = EVAS_RENDER_MUL;
+   fake_cmd.draw.fillmode = fillmode;
    blend = evas_filter_blend_cpu_func_get(&fake_cmd);
    EINA_SAFETY_ON_NULL_RETURN_VAL(blend, EINA_FALSE);
    ret = blend(&fake_cmd);
@@ -387,6 +402,7 @@ _mask_cpu_rgba_rgba_rgba(Evas_Filter_Command *cmd)
    fake_cmd.draw.render_op = EVAS_RENDER_BLEND;
    fake_cmd.input = fb;
    fake_cmd.output = cmd->output;
+   fake_cmd.draw.fillmode = EVAS_FILTER_FILL_MODE_NONE;
    blend = evas_filter_blend_cpu_func_get(&fake_cmd);
    EINA_SAFETY_ON_NULL_RETURN_VAL(blend, EINA_FALSE);
    ret = blend(&fake_cmd);
diff --git a/src/lib/evas/filters/evas_filter_parser.c 
b/src/lib/evas/filters/evas_filter_parser.c
index b72f8f6..7f47c44 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -1520,7 +1520,7 @@ _grow_instruction_prepare(Evas_Filter_Instruction *instr)
   Blend two input buffers into a third (target).
 
   @code
-    mask (mask, src = input, dst = output, color = white, fillmode = none);
+    mask (mask, src = input, dst = output, color = white, fillmode = repeat);
   @endcode
 
   @param mask     A mask or texture to blend with the input @a src into the 
target @a dst.
@@ -1528,7 +1528,8 @@ _grow_instruction_prepare(Evas_Filter_Instruction *instr)
   @param dst      Destination buffer for blending. This must be of same size 
and colorspace as @a src.
   @param color    A color to use for alpha to RGBA conversion for the blend 
operations. White means no change.
                   See @ref evasfilters_color "colors". This will have no 
effect on RGBA sources.
-  @param fillmode Defines whether to stretch or repeat the @a mask if its size 
that of @src. Should be set when masking with external textures. Default is 
none. See @ref evasfilter_fillmode "fillmodes".
+  @param fillmode Defines whether to stretch or repeat the @a mask if its size 
that of @src.
+                  Should be set when masking with external textures. Default 
is repeat. See @ref evasfilter_fillmode "fillmodes".
 
   Note that @a src and @a mask are interchangeable, if they have the same 
dimensions.
 
@@ -1556,7 +1557,7 @@ _mask_instruction_prepare(Evas_Filter_Instruction *instr)
    _instruction_param_seq_add(instr, "src", VT_BUFFER, "input");
    _instruction_param_seq_add(instr, "dst", VT_BUFFER, "output");
    _instruction_param_name_add(instr, "color", VT_COLOR, 0xFFFFFFFF);
-   _instruction_param_name_add(instr, "fillmode", VT_STRING, "none");
+   _instruction_param_name_add(instr, "fillmode", VT_STRING, "repeat");
 
    return EINA_TRUE;
 }

-- 


Reply via email to