summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-01-21 16:01:19 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-07 17:33:17 +0900
commit2d071a2cd4dff27de960d93c7facf60eaef0cfa4 (patch)
treedc67cff6323f7facec7f7f162aff77d091799e52 /src
parent8062df320c579ad053ef73c0930afe9c2b003ce4 (diff)
Evas filters: Fix mask function
Mask iteration was not valid.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/filters/evas_filter_mask.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/evas/filters/evas_filter_mask.c b/src/lib/evas/filters/evas_filter_mask.c
index 898dfbb2e2..4f7f224320 100644
--- a/src/lib/evas/filters/evas_filter_mask.c
+++ b/src/lib/evas/filters/evas_filter_mask.c
@@ -169,7 +169,7 @@ _mask_cpu_alpha_rgba_rgba(Evas_Filter_Command *cmd)
169 DATA8 *src; 169 DATA8 *src;
170 DATA32 *dst, *msk, *span; 170 DATA32 *dst, *msk, *span;
171 int op = cmd->draw.render_op; 171 int op = cmd->draw.render_op;
172 int w, h, mw, mh, x, y, my; 172 int w, h, mw, mh, y, my, r;
173 int stepsize, stepcount, step; 173 int stepsize, stepcount, step;
174 DATA32 color2; 174 DATA32 color2;
175 175
@@ -227,7 +227,7 @@ _mask_cpu_alpha_rgba_rgba(Evas_Filter_Command *cmd)
227 func2 = evas_common_gfx_func_composite_pixel_color_span_get(mask, color2, out, 1, op); 227 func2 = evas_common_gfx_func_composite_pixel_color_span_get(mask, color2, out, 1, op);
228 228
229 // Apply mask using Gfx functions 229 // Apply mask using Gfx functions
230 for (y = 0, my = 0; y < h; y++, my++, msk += stepsize) 230 for (y = 0, my = 0; y < h; y++, my++, msk += mw)
231 { 231 {
232 if (my >= mh) 232 if (my >= mh)
233 { 233 {
@@ -242,14 +242,14 @@ _mask_cpu_alpha_rgba_rgba(Evas_Filter_Command *cmd)
242 func2(span, NULL, color2, dst, stepsize); 242 func2(span, NULL, color2, dst, stepsize);
243 } 243 }
244 244
245 x = stepsize * stepcount; 245 r = w - (stepsize * stepcount);
246 if (x < w) 246 if (r > 0)
247 { 247 {
248 memset(span, 0, (w - x) * sizeof(DATA32)); 248 memset(span, 0, r * sizeof(DATA32));
249 func1(msk, src, 0, span, w - x); 249 func1(msk, src, 0, span, r);
250 func2(span, NULL, color2, dst, w - x); 250 func2(span, NULL, color2, dst, r);
251 dst += w - x; 251 dst += r;
252 src += w - x; 252 src += r;
253 } 253 }
254 } 254 }
255 255
@@ -267,7 +267,7 @@ _mask_cpu_alpha_alpha_rgba(Evas_Filter_Command *cmd)
267 DATA32 *dst; 267 DATA32 *dst;
268 DATA32 color; 268 DATA32 color;
269 int op = cmd->draw.render_op; 269 int op = cmd->draw.render_op;
270 int w, h, mw, mh, x, y, my; 270 int w, h, mw, mh, y, my, r;
271 int stepsize, stepcount, step; 271 int stepsize, stepcount, step;
272 272
273 /* Mechanism: 273 /* Mechanism:
@@ -319,7 +319,7 @@ _mask_cpu_alpha_alpha_rgba(Evas_Filter_Command *cmd)
319 func = evas_common_gfx_func_composite_mask_color_span_get(color, out, 1, op); 319 func = evas_common_gfx_func_composite_mask_color_span_get(color, out, 1, op);
320 span_func = evas_common_alpha_func_get(EVAS_RENDER_MASK); 320 span_func = evas_common_alpha_func_get(EVAS_RENDER_MASK);
321 321
322 for (y = 0, my = 0; y < h; y++, my++, msk += stepsize) 322 for (y = 0, my = 0; y < h; y++, my++, msk += mw)
323 { 323 {
324 if (my >= mh) 324 if (my >= mh)
325 { 325 {
@@ -334,14 +334,14 @@ _mask_cpu_alpha_alpha_rgba(Evas_Filter_Command *cmd)
334 func(NULL, span, color, dst, stepsize); 334 func(NULL, span, color, dst, stepsize);
335 } 335 }
336 336
337 x = stepsize * stepcount; 337 r = w - (stepsize * stepcount);
338 if (x < w) 338 if (r > 0)
339 { 339 {
340 memcpy(span, msk, (w - x) * sizeof(DATA8)); 340 memcpy(span, msk, r * sizeof(DATA8));
341 span_func(src, span, w - x); 341 span_func(src, span, r);
342 func(NULL, span, color, dst, w - x); 342 func(NULL, span, color, dst, r);
343 dst += w - x; 343 dst += r;
344 src += w - x; 344 src += r;
345 } 345 }
346 } 346 }
347 347