summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-03-25 12:27:21 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-03-26 10:48:12 +0900
commit7e731ea10afc30246c6004a367deb09470640ff3 (patch)
tree54e58d941ef42509dc58dd9f03dab1bc7d44159c /src
parent3083732bfbe4a45cf596bd732d154c156bcae2a2 (diff)
Evas filters: Ignore ox,oy when stretching in the same direction
During padding calculation, ox and oy should be ignored unless the blend operation is neither repeating nor stretching. Otherwise, the buffer will grow without necessity.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index aaa9e7b..b72f8f6 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -263,6 +263,8 @@ static struct
263 { "stretch_xy", EVAS_FILTER_FILL_MODE_STRETCH_XY } 263 { "stretch_xy", EVAS_FILTER_FILL_MODE_STRETCH_XY }
264}; 264};
265 265
266static Evas_Filter_Fill_Mode _fill_mode_get(Evas_Filter_Instruction *instr);
267
266typedef enum 268typedef enum
267{ 269{
268 VT_NONE, 270 VT_NONE,
@@ -924,6 +926,7 @@ _blend_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
924 int *padl, int *padr, int *padt, int *padb) 926 int *padl, int *padr, int *padt, int *padb)
925{ 927{
926 const char *inbuf, *outbuf; 928 const char *inbuf, *outbuf;
929 Evas_Filter_Fill_Mode fillmode;
927 Buffer *in, *out; 930 Buffer *in, *out;
928 int ox, oy, l = 0, r = 0, t = 0, b = 0; 931 int ox, oy, l = 0, r = 0, t = 0, b = 0;
929 932
@@ -938,6 +941,10 @@ _blend_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
938 out = _buffer_get(pgm, outbuf); 941 out = _buffer_get(pgm, outbuf);
939 EINA_SAFETY_ON_NULL_RETURN(out); 942 EINA_SAFETY_ON_NULL_RETURN(out);
940 943
944 fillmode = _fill_mode_get(instr);
945 if (fillmode & (EVAS_FILTER_FILL_MODE_STRETCH_X | EVAS_FILTER_FILL_MODE_REPEAT_X)) ox = 0;
946 if (fillmode & (EVAS_FILTER_FILL_MODE_STRETCH_Y | EVAS_FILTER_FILL_MODE_REPEAT_Y)) oy = 0;
947
941 if (ox < 0) l = (-ox) + in->pad.l; 948 if (ox < 0) l = (-ox) + in->pad.l;
942 else r = ox + in->pad.r; 949 else r = ox + in->pad.r;
943 950