summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-03-25 15:19:21 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-03-26 10:48:12 +0900
commit27d97110cca5f15cebbc9a05f610bb0275fbab4b (patch)
treeba569e7da626389926119c7e2460ff99e7c6c6b3 /src
parent7e731ea10afc30246c6004a367deb09470640ff3 (diff)
Evas filters: Default mask fillmode should be repeat
Fillmode "NONE" has basically no practical use and shouldn't be the default.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/filters/evas_filter_mask.c16
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c7
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
350_mask_cpu_rgba_rgba_rgba(Evas_Filter_Command *cmd) 350_mask_cpu_rgba_rgba_rgba(Evas_Filter_Command *cmd)
351{ 351{
352 Evas_Filter_Command fake_cmd; 352 Evas_Filter_Command fake_cmd;
353 Evas_Filter_Fill_Mode fillmode;
353 Evas_Filter_Apply_Func blend; 354 Evas_Filter_Apply_Func blend;
354 Evas_Filter_Buffer *fb; 355 Evas_Filter_Buffer *fb;
355 Eina_Bool ret; 356 Eina_Bool ret;
@@ -373,11 +374,25 @@ _mask_cpu_rgba_rgba_rgba(Evas_Filter_Command *cmd)
373 EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE); 374 EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE);
374 fb->locked = EINA_TRUE; 375 fb->locked = EINA_TRUE;
375 376
377 // Repeat mask if unspecified - NONE is not possible
378 fillmode = cmd->draw.fillmode;
379 if ((fillmode & (EVAS_FILTER_FILL_MODE_REPEAT_X | EVAS_FILTER_FILL_MODE_STRETCH_X)) == 0)
380 {
381 DBG("X fillmode not specified: defaults to repeat");
382 fillmode |= EVAS_FILTER_FILL_MODE_REPEAT_X;
383 }
384 if ((fillmode & (EVAS_FILTER_FILL_MODE_REPEAT_Y | EVAS_FILTER_FILL_MODE_STRETCH_Y)) == 0)
385 {
386 DBG("Y fillmode not specified: defaults to repeat");
387 fillmode |= EVAS_FILTER_FILL_MODE_REPEAT_Y;
388 }
389
376 // Mask --> Temp 390 // Mask --> Temp
377 fake_cmd.input = cmd->mask; 391 fake_cmd.input = cmd->mask;
378 fake_cmd.mask = NULL; 392 fake_cmd.mask = NULL;
379 fake_cmd.output = fb; 393 fake_cmd.output = fb;
380 fake_cmd.draw.render_op = EVAS_RENDER_MUL; 394 fake_cmd.draw.render_op = EVAS_RENDER_MUL;
395 fake_cmd.draw.fillmode = fillmode;
381 blend = evas_filter_blend_cpu_func_get(&fake_cmd); 396 blend = evas_filter_blend_cpu_func_get(&fake_cmd);
382 EINA_SAFETY_ON_NULL_RETURN_VAL(blend, EINA_FALSE); 397 EINA_SAFETY_ON_NULL_RETURN_VAL(blend, EINA_FALSE);
383 ret = blend(&fake_cmd); 398 ret = blend(&fake_cmd);
@@ -387,6 +402,7 @@ _mask_cpu_rgba_rgba_rgba(Evas_Filter_Command *cmd)
387 fake_cmd.draw.render_op = EVAS_RENDER_BLEND; 402 fake_cmd.draw.render_op = EVAS_RENDER_BLEND;
388 fake_cmd.input = fb; 403 fake_cmd.input = fb;
389 fake_cmd.output = cmd->output; 404 fake_cmd.output = cmd->output;
405 fake_cmd.draw.fillmode = EVAS_FILTER_FILL_MODE_NONE;
390 blend = evas_filter_blend_cpu_func_get(&fake_cmd); 406 blend = evas_filter_blend_cpu_func_get(&fake_cmd);
391 EINA_SAFETY_ON_NULL_RETURN_VAL(blend, EINA_FALSE); 407 EINA_SAFETY_ON_NULL_RETURN_VAL(blend, EINA_FALSE);
392 ret = blend(&fake_cmd); 408 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)
1520 Blend two input buffers into a third (target). 1520 Blend two input buffers into a third (target).
1521 1521
1522 @code 1522 @code
1523 mask (mask, src = input, dst = output, color = white, fillmode = none); 1523 mask (mask, src = input, dst = output, color = white, fillmode = repeat);
1524 @endcode 1524 @endcode
1525 1525
1526 @param mask A mask or texture to blend with the input @a src into the target @a dst. 1526 @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)
1528 @param dst Destination buffer for blending. This must be of same size and colorspace as @a src. 1528 @param dst Destination buffer for blending. This must be of same size and colorspace as @a src.
1529 @param color A color to use for alpha to RGBA conversion for the blend operations. White means no change. 1529 @param color A color to use for alpha to RGBA conversion for the blend operations. White means no change.
1530 See @ref evasfilters_color "colors". This will have no effect on RGBA sources. 1530 See @ref evasfilters_color "colors". This will have no effect on RGBA sources.
1531 @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". 1531 @param fillmode Defines whether to stretch or repeat the @a mask if its size that of @src.
1532 Should be set when masking with external textures. Default is repeat. See @ref evasfilter_fillmode "fillmodes".
1532 1533
1533 Note that @a src and @a mask are interchangeable, if they have the same dimensions. 1534 Note that @a src and @a mask are interchangeable, if they have the same dimensions.
1534 1535
@@ -1556,7 +1557,7 @@ _mask_instruction_prepare(Evas_Filter_Instruction *instr)
1556 _instruction_param_seq_add(instr, "src", VT_BUFFER, "input"); 1557 _instruction_param_seq_add(instr, "src", VT_BUFFER, "input");
1557 _instruction_param_seq_add(instr, "dst", VT_BUFFER, "output"); 1558 _instruction_param_seq_add(instr, "dst", VT_BUFFER, "output");
1558 _instruction_param_name_add(instr, "color", VT_COLOR, 0xFFFFFFFF); 1559 _instruction_param_name_add(instr, "color", VT_COLOR, 0xFFFFFFFF);
1559 _instruction_param_name_add(instr, "fillmode", VT_STRING, "none"); 1560 _instruction_param_name_add(instr, "fillmode", VT_STRING, "repeat");
1560 1561
1561 return EINA_TRUE; 1562 return EINA_TRUE;
1562} 1563}