summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-02-17 20:19:02 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-18 10:22:50 +0900
commitded097461d60213c92a28a91cbc63c3a7175e2de (patch)
tree1163641710517c8be963c23e41d2e2b543aea462
parent3819bc7abb954dd44b5074de0cc0333c8ca71f67 (diff)
Evas filters: Fix padding with "blend"
Test case was: buffer : a (alpha); blur (20, dst = a); blend (src = a, ox = 30); In that case, padding was 20, 30, 20, 20. So the blurred buffer was clipped on screen.
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 2894a12fca..48ec0a9e42 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -917,22 +917,26 @@ static void
917_blend_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr, 917_blend_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
918 int *padl, int *padr, int *padt, int *padb) 918 int *padl, int *padr, int *padt, int *padb)
919{ 919{
920 const char *outbuf; 920 const char *inbuf, *outbuf;
921 Buffer *out; 921 Buffer *in, *out;
922 int ox, oy, l = 0, r = 0, t = 0, b = 0; 922 int ox, oy, l = 0, r = 0, t = 0, b = 0;
923 923
924 ox = _instruction_param_geti(instr, "ox", NULL); 924 ox = _instruction_param_geti(instr, "ox", NULL);
925 oy = _instruction_param_geti(instr, "oy", NULL); 925 oy = _instruction_param_geti(instr, "oy", NULL);
926 926
927 inbuf = _instruction_param_gets(instr, "src", NULL);
928 in = _buffer_get(pgm, inbuf);
929 EINA_SAFETY_ON_NULL_RETURN(in);
930
927 outbuf = _instruction_param_gets(instr, "dst", NULL); 931 outbuf = _instruction_param_gets(instr, "dst", NULL);
928 out = _buffer_get(pgm, outbuf); 932 out = _buffer_get(pgm, outbuf);
929 EINA_SAFETY_ON_NULL_RETURN(out); 933 EINA_SAFETY_ON_NULL_RETURN(out);
930 934
931 if (ox < 0) l = (-ox); 935 if (ox < 0) l = (-ox) + in->pad.l;
932 else r = ox; 936 else r = ox + in->pad.r;
933 937
934 if (oy < 0) t = (-oy); 938 if (oy < 0) t = (-oy) + in->pad.t;
935 else b = oy; 939 else b = oy + in->pad.b;
936 940
937 if (out->pad.l < l) out->pad.l = l; 941 if (out->pad.l < l) out->pad.l = l;
938 if (out->pad.r < r) out->pad.r = r; 942 if (out->pad.r < r) out->pad.r = r;