summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_polygon_main.c
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2014-11-20 14:56:36 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-01-07 15:06:02 +0900
commit4eb3a58edd1b88fc2c71945d39c75336e038fdd7 (patch)
tree0f6a3c87eb9b273174690eed7a119284d2dbf5c3 /src/lib/evas/common/evas_polygon_main.c
parent6747fadd9a697236c5307f8cb1cb5e9ceec6dabe (diff)
Evas masking: Implement support for polygon draw (SW)
Diffstat (limited to 'src/lib/evas/common/evas_polygon_main.c')
-rw-r--r--src/lib/evas/common/evas_polygon_main.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/src/lib/evas/common/evas_polygon_main.c b/src/lib/evas/common/evas_polygon_main.c
index db56cdb61e..3b8690427a 100644
--- a/src/lib/evas/common/evas_polygon_main.c
+++ b/src/lib/evas/common/evas_polygon_main.c
@@ -279,7 +279,10 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
279 free(point); 279 free(point);
280 free(sorted_index); 280 free(sorted_index);
281 281
282 func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst->cache_entry.flags.alpha, 1, dc->render_op); 282 if(dc->clip.mask)
283 func = evas_common_gfx_func_composite_mask_color_span_get(dc->col.col, dst->cache_entry.flags.alpha, 1, dc->render_op);
284 else
285 func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst->cache_entry.flags.alpha, 1, dc->render_op);
283 if (spans) 286 if (spans)
284 { 287 {
285 RGBA_Span *span; 288 RGBA_Span *span;
@@ -287,6 +290,8 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
287 EINA_INLIST_FOREACH(spans, span) 290 EINA_INLIST_FOREACH(spans, span)
288 { 291 {
289 DATA32 *ptr; 292 DATA32 *ptr;
293 DATA8 *mask;
294 RGBA_Image *mask_ie;
290 295
291#ifdef HAVE_PIXMAN 296#ifdef HAVE_PIXMAN
292# ifdef PIXMAN_POLY 297# ifdef PIXMAN_POLY
@@ -300,7 +305,16 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
300#endif 305#endif
301 { 306 {
302 ptr = dst->image.data + (span->y * (dst->cache_entry.w)) + span->x; 307 ptr = dst->image.data + (span->y * (dst->cache_entry.w)) + span->x;
303 func(NULL, NULL, dc->col.col, ptr, span->w); 308 if (dc->clip.mask)
309 {
310 mask_ie = dc->clip.mask;
311 mask = mask_ie->image.data8
312 + ((span->y - dc->clip.mask_y) * mask_ie->cache_entry.w)
313 + (span->x - dc->clip.mask_x);
314 func(NULL, mask, dc->col.col, ptr, span->w);
315 }
316 else
317 func(NULL, NULL, dc->col.col, ptr, span->w);
304 } 318 }
305 } 319 }
306 while (spans) 320 while (spans)
@@ -313,7 +327,7 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
313} 327}
314 328
315EAPI void 329EAPI void
316evas_common_polygon_rgba_draw(RGBA_Image *dst, int ext_x, int ext_y, int ext_w, int ext_h, DATA32 col, int render_op, RGBA_Polygon_Point *points, int x, int y) 330evas_common_polygon_rgba_draw(RGBA_Image *dst, int ext_x, int ext_y, int ext_w, int ext_h, DATA32 col, int render_op, RGBA_Polygon_Point *points, int x, int y, RGBA_Image *mask_ie, int mask_x, int mask_y)
317{ 331{
318 RGBA_Gfx_Func func; 332 RGBA_Gfx_Func func;
319 RGBA_Polygon_Point *pt; 333 RGBA_Polygon_Point *pt;
@@ -435,17 +449,29 @@ evas_common_polygon_rgba_draw(RGBA_Image *dst, int ext_x, int ext_y, int ext_w,
435 free(point); 449 free(point);
436 free(sorted_index); 450 free(sorted_index);
437 451
438 func = evas_common_gfx_func_composite_color_span_get(col, dst->cache_entry.flags.alpha, 1, render_op); 452 if (mask_ie)
453 func = evas_common_gfx_func_composite_mask_color_span_get(col, dst->cache_entry.flags.alpha, 1, render_op);
454 else
455 func = evas_common_gfx_func_composite_color_span_get(col, dst->cache_entry.flags.alpha, 1, render_op);
439 if (spans) 456 if (spans)
440 { 457 {
441 RGBA_Span *span; 458 RGBA_Span *span;
459 DATA8 *mask;
442 460
443 EINA_INLIST_FOREACH(spans, span) 461 EINA_INLIST_FOREACH(spans, span)
444 { 462 {
445 DATA32 *ptr; 463 DATA32 *ptr;
446 464
447 ptr = dst->image.data + (span->y * (dst->cache_entry.w)) + span->x; 465 ptr = dst->image.data + (span->y * (dst->cache_entry.w)) + span->x;
448 func(NULL, NULL, col, ptr, span->w); 466 if (mask_ie)
467 {
468 mask = mask_ie->image.data8
469 + ((span->y - mask_y) * mask_ie->cache_entry.w)
470 + (span->x - mask_x);
471 func(NULL, mask, col, ptr, span->w);
472 }
473 else
474 func(NULL, NULL, col, ptr, span->w);
449 } 475 }
450 while (spans) 476 while (spans)
451 { 477 {