summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-02-18 17:01:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-20 13:27:42 +0900
commitddf267e50695770801ef2d627dd590db8c91759e (patch)
treebae6c48726dcb27663df0bf6aba3269a2a9ac08f /src
parent126cbbc7a99a8368032b5706349a47edfa1643c8 (diff)
Evas filters: Fix padding in blur filter
The wrong value was used for the command's padding. Also, remove mention of "motion" blur which is not implemented.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 01ff619b95..3dfc423946 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -1017,14 +1017,13 @@ _blur_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
1017{ 1017{
1018 Eina_Bool yset; 1018 Eina_Bool yset;
1019 int rx, ry, ox, oy, l, r, t, b; 1019 int rx, ry, ox, oy, l, r, t, b;
1020 const char *typestr, *inbuf, *outbuf; 1020 const char *inbuf, *outbuf;
1021 Buffer *in, *out; 1021 Buffer *in, *out;
1022 1022
1023 rx = _instruction_param_geti(instr, "rx", NULL); 1023 rx = _instruction_param_geti(instr, "rx", NULL);
1024 ry = _instruction_param_geti(instr, "ry", &yset); 1024 ry = _instruction_param_geti(instr, "ry", &yset);
1025 ox = _instruction_param_geti(instr, "ox", NULL); 1025 ox = _instruction_param_geti(instr, "ox", NULL);
1026 oy = _instruction_param_geti(instr, "oy", NULL); 1026 oy = _instruction_param_geti(instr, "oy", NULL);
1027 typestr = _instruction_param_gets(instr, "type", NULL);
1028 inbuf = _instruction_param_gets(instr, "src", NULL); 1027 inbuf = _instruction_param_gets(instr, "src", NULL);
1029 outbuf = _instruction_param_gets(instr, "dst", NULL); 1028 outbuf = _instruction_param_gets(instr, "dst", NULL);
1030 1029
@@ -1033,37 +1032,24 @@ _blur_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
1033 EINA_SAFETY_ON_NULL_RETURN(in); 1032 EINA_SAFETY_ON_NULL_RETURN(in);
1034 EINA_SAFETY_ON_NULL_RETURN(out); 1033 EINA_SAFETY_ON_NULL_RETURN(out);
1035 1034
1036 if (typestr && !strcasecmp(typestr, "motion")) 1035 if (!yset) ry = rx;
1037 { 1036 if (rx < 0) rx = 0;
1038 CRI("Motion blur not implemented yet!"); 1037 if (ry < 0) ry = 0;
1039 /* 1038
1040 instr->pad.l = (rx < 0) ? (-rx) : 0; 1039 l = rx + in->pad.l - ox;
1041 instr->pad.r = (rx > 0) ? (rx) : 0; 1040 r = rx + in->pad.r + ox;
1042 instr->pad.t = (ry < 0) ? (-ry) : 0; 1041 t = ry + in->pad.t - oy;
1043 instr->pad.b = (ry > 0) ? (ry) : 0; 1042 b = ry + in->pad.b + oy;
1044 */ 1043
1045 } 1044 if (out->pad.l < l) out->pad.l = l;
1046 else 1045 if (out->pad.r < r) out->pad.r = r;
1047 { 1046 if (out->pad.t < t) out->pad.t = t;
1048 if (!yset) ry = rx; 1047 if (out->pad.b < b) out->pad.b = b;
1049 if (rx < 0) rx = 0; 1048
1050 if (ry < 0) ry = 0; 1049 if (padl) *padl = l;
1051 1050 if (padr) *padr = r;
1052 l = rx + in->pad.l - ox; 1051 if (padt) *padt = t;
1053 r = rx + in->pad.r + ox; 1052 if (padb) *padb = b;
1054 t = ry + in->pad.t - oy;
1055 b = ry + in->pad.b + oy;
1056
1057 if (out->pad.l < l) out->pad.l = l;
1058 if (out->pad.r < r) out->pad.r = r;
1059 if (out->pad.t < t) out->pad.t = t;
1060 if (out->pad.b < b) out->pad.b = b;
1061
1062 if (padl) *padl = rx - ox;
1063 if (padr) *padr = rx + ox;
1064 if (padt) *padt = ry - oy;
1065 if (padb) *padb = ry + oy;
1066 }
1067} 1053}
1068 1054
1069/** 1055/**