diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/evas/src/lib/engines/common/evas_line_main.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to 'libraries/evas/src/lib/engines/common/evas_line_main.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_line_main.c | 475 |
1 files changed, 413 insertions, 62 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_line_main.c b/libraries/evas/src/lib/engines/common/evas_line_main.c index 04401cb..aacf805 100644 --- a/libraries/evas/src/lib/engines/common/evas_line_main.c +++ b/libraries/evas/src/lib/engines/common/evas_line_main.c | |||
@@ -109,9 +109,24 @@ _evas_draw_point(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y) | |||
109 | return; | 109 | return; |
110 | if ((dc->clip.use) && (!IN_RECT(x, y, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h))) | 110 | if ((dc->clip.use) && (!IN_RECT(x, y, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h))) |
111 | return; | 111 | return; |
112 | pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst, dc->render_op); | 112 | #ifdef HAVE_PIXMAN |
113 | if (pfunc) | 113 | # ifdef PIXMAN_LINE |
114 | pfunc(0, 255, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x); | 114 | pixman_op_t op = PIXMAN_OP_SRC; |
115 | |||
116 | if (dc->render_op == _EVAS_RENDER_BLEND) | ||
117 | op = PIXMAN_OP_OVER; | ||
118 | |||
119 | if ((dst->pixman.im) && (dc->col.pixman_color_image)) | ||
120 | pixman_image_composite(op, dc->col.pixman_color_image, NULL, | ||
121 | dst->pixman.im, x, y, 0, 0, x, y, 1, 1); | ||
122 | else | ||
123 | # endif | ||
124 | #endif | ||
125 | { | ||
126 | pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst, dc->render_op); | ||
127 | if (pfunc) | ||
128 | pfunc(0, 255, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x); | ||
129 | } | ||
115 | } | 130 | } |
116 | 131 | ||
117 | /* | 132 | /* |
@@ -130,6 +145,14 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i | |||
130 | RGBA_Gfx_Pt_Func pfunc; | 145 | RGBA_Gfx_Pt_Func pfunc; |
131 | RGBA_Gfx_Func sfunc; | 146 | RGBA_Gfx_Func sfunc; |
132 | 147 | ||
148 | #ifdef HAVE_PIXMAN | ||
149 | # ifdef PIXMAN_LINE | ||
150 | pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY | ||
151 | if (dc->render_op == _EVAS_RENDER_BLEND) | ||
152 | op = PIXMAN_OP_OVER; | ||
153 | # endif | ||
154 | #endif | ||
155 | |||
133 | dstw = dst->cache_entry.w; | 156 | dstw = dst->cache_entry.w; |
134 | color = dc->col.col; | 157 | color = dc->col.col; |
135 | 158 | ||
@@ -172,12 +195,30 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i | |||
172 | 195 | ||
173 | len = x1 - x0 + 1; | 196 | len = x1 - x0 + 1; |
174 | p = dst->image.data + (dstw * y0) + x0; | 197 | p = dst->image.data + (dstw * y0) + x0; |
175 | sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op); | 198 | #ifdef HAVE_PIXMAN |
176 | if (sfunc) | 199 | # ifdef PIXMAN_LINE |
177 | sfunc(NULL, NULL, color, p, len); | 200 | if ((dst->pixman.im) && (dc->col.pixman_color_image) && |
178 | } | 201 | (!dc->mask.mask)) |
179 | } | 202 | pixman_image_composite(op, dc->col.pixman_color_image, |
180 | return; | 203 | NULL, dst->pixman.im, |
204 | x0, y0, 0, 0, x0, y0, len, 1); | ||
205 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
206 | (dc->mask.mask)) | ||
207 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
208 | dc->mask.mask->pixman.im, | ||
209 | dst->pixman.im, | ||
210 | x0, y0, 0, 0, x0, y0, len, 1); | ||
211 | else | ||
212 | # endif | ||
213 | #endif | ||
214 | { | ||
215 | sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op); | ||
216 | if (sfunc) | ||
217 | sfunc(NULL, NULL, color, p, len); | ||
218 | } | ||
219 | } | ||
220 | } | ||
221 | return; | ||
181 | } | 222 | } |
182 | 223 | ||
183 | pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst, dc->render_op); | 224 | pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst, dc->render_op); |
@@ -192,17 +233,34 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i | |||
192 | 233 | ||
193 | len = y1 - y0 + 1; | 234 | len = y1 - y0 + 1; |
194 | p = dst->image.data + (dstw * y0) + x0; | 235 | p = dst->image.data + (dstw * y0) + x0; |
195 | while (len--) | 236 | #ifdef HAVE_PIXMAN |
196 | { | 237 | # ifdef PIXMAN_LINE |
238 | if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
239 | (!dc->mask.mask)) | ||
240 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
241 | NULL, dst->pixman.im, | ||
242 | x0, y0, 0, 0, x0, y0, 1, len); | ||
243 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
244 | (dc->mask.mask)) | ||
245 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
246 | dc->mask.mask->pixman.im, dst->pixman.im, | ||
247 | x0, y0, 0, 0, x0, y0, 1, len); | ||
248 | else | ||
249 | # endif | ||
250 | #endif | ||
251 | { | ||
252 | while (len--) | ||
253 | { | ||
197 | #ifdef EVAS_SLI | 254 | #ifdef EVAS_SLI |
198 | if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y) | 255 | if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y) |
199 | #endif | 256 | #endif |
200 | { | 257 | { |
201 | pfunc(0, 255, color, p); | 258 | pfunc(0, 255, color, p); |
202 | } | 259 | } |
203 | p += dstw; | 260 | p += dstw; |
204 | } | 261 | } |
205 | } | 262 | } |
263 | } | ||
206 | return; | 264 | return; |
207 | } | 265 | } |
208 | 266 | ||
@@ -281,16 +339,52 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i | |||
281 | if (dx > 0) dstw--; | 339 | if (dx > 0) dstw--; |
282 | else dstw++; | 340 | else dstw++; |
283 | } | 341 | } |
284 | 342 | #ifdef HAVE_PIXMAN | |
343 | # ifdef PIXMAN_LINE | ||
344 | int pixman_x_position = x0; | ||
345 | int pixman_y_position = y0; | ||
346 | int x_unit = dstw - dst->cache_entry.w; | ||
347 | # endif | ||
348 | #endif | ||
349 | |||
350 | |||
285 | while (len--) | 351 | while (len--) |
286 | { | 352 | { |
287 | #ifdef EVAS_SLI | 353 | #ifdef EVAS_SLI |
288 | if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y) | 354 | if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y) |
289 | #endif | 355 | #endif |
290 | { | 356 | { |
291 | pfunc(0, 255, color, p); | 357 | #ifdef HAVE_PIXMAN |
292 | } | 358 | # ifdef PIXMAN_LINE |
293 | p += dstw; | 359 | if ((dst->pixman.im) && (dc->col.pixman_color_image) && |
360 | (!dc->mask.mask)) | ||
361 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
362 | NULL, dst->pixman.im, | ||
363 | pixman_x_position, | ||
364 | pixman_y_position, | ||
365 | 0, 0, pixman_x_position, | ||
366 | pixman_y_position, 1, 1); | ||
367 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
368 | (dc->mask.mask)) | ||
369 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
370 | dc->mask.mask->pixman.im, | ||
371 | dst->pixman.im, | ||
372 | pixman_x_position, | ||
373 | pixman_y_position, 0, 0, | ||
374 | pixman_x_position, | ||
375 | pixman_y_position, 1, 1); | ||
376 | else | ||
377 | # endif | ||
378 | #endif | ||
379 | pfunc(0, 255, color, p); | ||
380 | } | ||
381 | #ifdef HAVE_PIXMAN | ||
382 | # ifdef PIXMAN_LINE | ||
383 | pixman_x_position += x_unit; | ||
384 | pixman_y_position += 1; | ||
385 | # endif | ||
386 | #endif | ||
387 | p += dstw; | ||
294 | } | 388 | } |
295 | } | 389 | } |
296 | } | 390 | } |
@@ -456,6 +550,31 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, | |||
456 | dx = x1 - x0; | 550 | dx = x1 - x0; |
457 | dy = y1 - y0; | 551 | dy = y1 - y0; |
458 | 552 | ||
553 | #ifdef HAVE_PIXMAN | ||
554 | # ifdef PIXMAN_LINE | ||
555 | int pix_x; | ||
556 | int pix_y; | ||
557 | int pix_x_unit; | ||
558 | int pix_y_unit; | ||
559 | |||
560 | pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY | ||
561 | if (dc->render_op == _EVAS_RENDER_BLEND) | ||
562 | op = PIXMAN_OP_OVER; | ||
563 | pix_x = x0; | ||
564 | pix_y = y0; | ||
565 | |||
566 | if (dx < 0) | ||
567 | pix_x_unit = -1; | ||
568 | else | ||
569 | pix_x_unit = 1; | ||
570 | |||
571 | if (dy < 0) | ||
572 | pix_y_unit = -1; | ||
573 | else | ||
574 | pix_y_unit = 1; | ||
575 | # endif | ||
576 | #endif | ||
577 | |||
459 | if ( (dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy) ) | 578 | if ( (dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy) ) |
460 | { | 579 | { |
461 | _evas_draw_simple_line(dst, dc, x0, y0, x1, y1); | 580 | _evas_draw_simple_line(dst, dc, x0, y0, x1, y1); |
@@ -494,6 +613,11 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, | |||
494 | prev_y = y; | 613 | prev_y = y; |
495 | p += dh; | 614 | p += dh; |
496 | py += dely; | 615 | py += dely; |
616 | #ifdef HAVE_PIXMAN | ||
617 | # ifdef PIXMAN_LINE | ||
618 | pix_y += pix_y_unit; | ||
619 | # endif | ||
620 | #endif | ||
497 | } | 621 | } |
498 | if (!p1_in) | 622 | if (!p1_in) |
499 | { | 623 | { |
@@ -509,12 +633,37 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, | |||
509 | #endif | 633 | #endif |
510 | { | 634 | { |
511 | if (IN_RANGE(px, py, clw, clh)) | 635 | if (IN_RANGE(px, py, clw, clh)) |
512 | pfunc(0, 255, color, p); | 636 | { |
513 | } | 637 | #ifdef HAVE_PIXMAN |
514 | next_x: | 638 | # ifdef PIXMAN_LINE |
515 | yy += dyy; | 639 | if ((dst->pixman.im) && (dc->col.pixman_color_image) && |
516 | px++; | 640 | (!dc->mask.mask)) |
517 | p++; | 641 | pixman_image_composite(op, dc->col.pixman_color_image, |
642 | NULL, dst->pixman.im, | ||
643 | pix_x, pix_y, 0, 0, | ||
644 | pix_x, pix_y, 1, 1); | ||
645 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
646 | (dc->mask.mask)) | ||
647 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
648 | dc->mask.mask->pixman.im, | ||
649 | dst->pixman.im, | ||
650 | pix_x, pix_y, 0, 0, | ||
651 | pix_x, pix_y, 1, 1); | ||
652 | else | ||
653 | # endif | ||
654 | #endif | ||
655 | pfunc(0, 255, color, p); | ||
656 | } | ||
657 | } | ||
658 | next_x: | ||
659 | yy += dyy; | ||
660 | px++; | ||
661 | p++; | ||
662 | #ifdef HAVE_PIXMAN | ||
663 | # ifdef PIXMAN_LINE | ||
664 | pix_x += pix_x_unit; | ||
665 | # endif | ||
666 | #endif | ||
518 | } | 667 | } |
519 | return; | 668 | return; |
520 | } | 669 | } |
@@ -529,9 +678,14 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, | |||
529 | x += ((xx - (x << 16)) >> 15); | 678 | x += ((xx - (x << 16)) >> 15); |
530 | if (prev_x != x) | 679 | if (prev_x != x) |
531 | { | 680 | { |
532 | prev_x = x; | 681 | prev_x = x; |
533 | px += delx; | 682 | px += delx; |
534 | p += delx; | 683 | p += delx; |
684 | #ifdef HAVE_PIXMAN | ||
685 | # ifdef PIXMAN_LINE | ||
686 | pix_x += pix_x_unit; | ||
687 | # endif | ||
688 | #endif | ||
535 | } | 689 | } |
536 | if (!p1_in) | 690 | if (!p1_in) |
537 | { | 691 | { |
@@ -547,12 +701,38 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, | |||
547 | #endif | 701 | #endif |
548 | { | 702 | { |
549 | if (IN_RANGE(px, py, clw, clh)) | 703 | if (IN_RANGE(px, py, clw, clh)) |
550 | pfunc(0, 255, color, p); | 704 | { |
551 | } | 705 | #ifdef HAVE_PIXMAN |
552 | next_y: | 706 | # ifdef PIXMAN_LINE |
707 | if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
708 | (!dc->mask.mask)) | ||
709 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
710 | NULL, dst->pixman.im, | ||
711 | pix_x, pix_y, 0, 0, | ||
712 | pix_x, pix_y, 1, 1); | ||
713 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
714 | (dc->mask.mask)) | ||
715 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
716 | dc->mask.mask->pixman.im, | ||
717 | dst->pixman.im, | ||
718 | pix_x, pix_y, 0, 0, | ||
719 | pix_x, pix_y, 1, 1); | ||
720 | else | ||
721 | # endif | ||
722 | #endif | ||
723 | pfunc(0, 255, color, p); | ||
724 | } | ||
725 | } | ||
726 | next_y: | ||
553 | xx += dxx; | 727 | xx += dxx; |
554 | py++; | 728 | py++; |
555 | p += dstw; | 729 | p += dstw; |
730 | #ifdef HAVE_PIXMAN | ||
731 | # ifdef PIXMAN_LINE | ||
732 | pix_y += pix_y_unit; | ||
733 | # endif | ||
734 | #endif | ||
735 | |||
556 | } | 736 | } |
557 | } | 737 | } |
558 | 738 | ||
@@ -568,12 +748,43 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x | |||
568 | DATA32 *p, *data, color; | 748 | DATA32 *p, *data, color; |
569 | RGBA_Gfx_Pt_Func pfunc; | 749 | RGBA_Gfx_Pt_Func pfunc; |
570 | 750 | ||
751 | dx = x1 - x0; | ||
752 | dy = y1 - y0; | ||
753 | |||
754 | #ifdef HAVE_PIXMAN | ||
755 | # ifdef PIXMAN_LINE | ||
756 | int pix_x; | ||
757 | int pix_y; | ||
758 | int pix_x_unit; | ||
759 | int pix_y_unit; | ||
760 | |||
761 | pixman_image_t *aa_mask_image; | ||
762 | int alpha_data_buffer; | ||
763 | |||
764 | pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY | ||
765 | if (dc->render_op == _EVAS_RENDER_BLEND) | ||
766 | op = PIXMAN_OP_OVER; | ||
767 | pix_x = x0; | ||
768 | pix_y = y0; | ||
769 | |||
770 | if (dx < 0) | ||
771 | pix_x_unit = -1; | ||
772 | else | ||
773 | pix_x_unit = 1; | ||
774 | |||
775 | if (dy < 0) | ||
776 | pix_y_unit = -1; | ||
777 | else | ||
778 | pix_y_unit = 1; | ||
779 | # endif | ||
780 | #endif | ||
571 | if (y0 > y1) | 781 | if (y0 > y1) |
572 | EXCHANGE_POINTS(x0, y0, x1, y1); | 782 | EXCHANGE_POINTS(x0, y0, x1, y1); |
783 | |||
573 | dx = x1 - x0; | 784 | dx = x1 - x0; |
574 | dy = y1 - y0; | 785 | dy = y1 - y0; |
575 | 786 | ||
576 | if ( (dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy) ) | 787 | if ((dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy)) |
577 | { | 788 | { |
578 | _evas_draw_simple_line(dst, dc, x0, y0, x1, y1); | 789 | _evas_draw_simple_line(dst, dc, x0, y0, x1, y1); |
579 | return; | 790 | return; |
@@ -609,9 +820,14 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x | |||
609 | y = (yy >> 16); | 820 | y = (yy >> 16); |
610 | if (prev_y != y) | 821 | if (prev_y != y) |
611 | { | 822 | { |
612 | prev_y = y; | 823 | prev_y = y; |
613 | p += dh; | 824 | p += dh; |
614 | py += dely; | 825 | py += dely; |
826 | #ifdef HAVE_PIXMAN | ||
827 | # ifdef PIXMAN_LINE | ||
828 | pix_y += pix_y_unit; | ||
829 | # endif | ||
830 | #endif | ||
615 | } | 831 | } |
616 | if (!p1_in) | 832 | if (!p1_in) |
617 | { | 833 | { |
@@ -624,39 +840,109 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x | |||
624 | } | 840 | } |
625 | if (px < clw) | 841 | if (px < clw) |
626 | { | 842 | { |
627 | aa = ((yy - (y << 16)) >> 8); | 843 | aa = ((yy - (y << 16)) >> 8); |
628 | if ((py) < clh) | 844 | if ((py) < clh) |
629 | pfunc(0, 255 - aa, color, p); | 845 | { |
630 | if ((py + 1) < clh) | 846 | #ifdef HAVE_PIXMAN |
631 | pfunc(0, aa, color, p + dstw); | 847 | # ifdef PIXMAN_LINE |
632 | } | 848 | alpha_data_buffer = 255 - aa; |
633 | 849 | aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, | |
634 | next_x: | 850 | (uint32_t *)&alpha_data_buffer, 4); |
635 | yy += dyy; | 851 | |
636 | px++; | 852 | if ((dst->pixman.im) && (dc->col.pixman_color_image ) && |
637 | p++; | 853 | (!dc->mask.mask)) |
854 | pixman_image_composite(PIXMAN_OP_OVER, | ||
855 | dc->col.pixman_color_image, | ||
856 | aa_mask_image, dst->pixman.im, | ||
857 | pix_x, pix_y, 0, 0, | ||
858 | pix_x, pix_y, 1, 1); | ||
859 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
860 | (dc->mask.mask) ) | ||
861 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
862 | dc->mask.mask->pixman.im, | ||
863 | dst->pixman.im, | ||
864 | pix_x, pix_y, 0, 0, | ||
865 | pix_x, pix_y, 1, 1); | ||
866 | else | ||
867 | # endif | ||
868 | #endif | ||
869 | pfunc(0, 255 - aa, color, p); | ||
870 | #ifdef HAVE_PIXMAN | ||
871 | # ifdef PIXMAN_LINE | ||
872 | pixman_image_unref(aa_mask_image); | ||
873 | # endif | ||
874 | #endif | ||
875 | } | ||
876 | if ((py + 1) < clh) | ||
877 | { | ||
878 | #ifdef HAVE_PIXMAN | ||
879 | # ifdef PIXMAN_LINE | ||
880 | alpha_data_buffer = aa; | ||
881 | aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, | ||
882 | (uint32_t *)&alpha_data_buffer, 4); | ||
883 | |||
884 | if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
885 | (!dc->mask.mask)) | ||
886 | pixman_image_composite(PIXMAN_OP_OVER, | ||
887 | dc->col.pixman_color_image, | ||
888 | aa_mask_image, dst->pixman.im, | ||
889 | pix_x, pix_y + 1, 0, 0, | ||
890 | pix_x, pix_y + 1, 1, 1); | ||
891 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
892 | (dc->mask.mask)) | ||
893 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
894 | dc->mask.mask->pixman.im, | ||
895 | dst->pixman.im, | ||
896 | pix_x, pix_y + 1, 0, 0, | ||
897 | pix_x, pix_y + 1, 1, 1); | ||
898 | else | ||
899 | # endif | ||
900 | #endif | ||
901 | pfunc(0, aa, color, p + dstw); | ||
902 | #ifdef HAVE_PIXMAN | ||
903 | # ifdef PIXMAN_LINE | ||
904 | pixman_image_unref(aa_mask_image); | ||
905 | # endif | ||
906 | #endif | ||
907 | } | ||
908 | } | ||
909 | |||
910 | next_x: | ||
911 | yy += dyy; | ||
912 | px++; | ||
913 | p++; | ||
914 | #ifdef HAVE_PIXMAN | ||
915 | # ifdef PIXMAN_LINE | ||
916 | pix_x += pix_x_unit; | ||
917 | # endif | ||
918 | #endif | ||
638 | } | 919 | } |
639 | return; | 920 | return; |
640 | } | 921 | } |
641 | 922 | ||
642 | /* steep: y-parametric */ | 923 | /* steep: y-parametric */ |
643 | SETUP_LINE_STEEP; | 924 | SETUP_LINE_STEEP; |
644 | 925 | ||
645 | while (py < by) | 926 | while (py < by) |
646 | { | 927 | { |
647 | DATA8 aa; | 928 | DATA8 aa; |
648 | 929 | ||
649 | x = (xx >> 16); | 930 | x = (xx >> 16); |
650 | if (prev_x != x) | 931 | if (prev_x != x) |
651 | { | 932 | { |
652 | prev_x = x; | 933 | prev_x = x; |
653 | px += delx; | 934 | px += delx; |
654 | p += delx; | 935 | p += delx; |
936 | #ifdef HAVE_PIXMAN | ||
937 | # ifdef PIXMAN_LINE | ||
938 | pix_x += pix_x_unit; | ||
939 | # endif | ||
940 | #endif | ||
655 | } | 941 | } |
656 | if (!p1_in) | 942 | if (!p1_in) |
657 | { | 943 | { |
658 | if ((px < 0) && (delx < 0)) return; | 944 | if ((px < 0) && (delx < 0)) return; |
659 | if ((px > rx) && (delx > 0)) return; | 945 | if ((px > rx) && (delx > 0)) return; |
660 | } | 946 | } |
661 | if (!p0_in) | 947 | if (!p0_in) |
662 | { | 948 | { |
@@ -664,15 +950,80 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x | |||
664 | } | 950 | } |
665 | if (py < clh) | 951 | if (py < clh) |
666 | { | 952 | { |
667 | aa = ((xx - (x << 16)) >> 8); | 953 | aa = ((xx - (x << 16)) >> 8); |
668 | if ((px) < clw) | 954 | if ((px) < clw) |
669 | pfunc(0, 255 - aa, color, p); | 955 | { |
670 | if ((px + 1) < clw) | 956 | #ifdef HAVE_PIXMAN |
671 | pfunc(0, aa, color, p + 1); | 957 | # ifdef PIXMAN_LINE |
672 | } | 958 | alpha_data_buffer = 255 - aa; |
959 | aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, (uint32_t *)&alpha_data_buffer, 4); | ||
960 | |||
961 | if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
962 | (!dc->mask.mask)) | ||
963 | pixman_image_composite(PIXMAN_OP_OVER, | ||
964 | dc->col.pixman_color_image, | ||
965 | aa_mask_image, dst->pixman.im, | ||
966 | pix_x, pix_y, 0, 0, | ||
967 | pix_x, pix_y, 1, 1); | ||
968 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
969 | (dc->mask.mask)) | ||
970 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
971 | dc->mask.mask->pixman.im, | ||
972 | dst->pixman.im, | ||
973 | pix_x, pix_y, 0, 0, | ||
974 | pix_x, pix_y, 1, 1); | ||
975 | else | ||
976 | # endif | ||
977 | #endif | ||
978 | pfunc(0, 255 - aa, color, p); | ||
979 | #ifdef HAVE_PIXMAN | ||
980 | # ifdef PIXMAN_LINE | ||
981 | pixman_image_unref(aa_mask_image); | ||
982 | # endif | ||
983 | #endif | ||
984 | |||
985 | } | ||
986 | if ((px + 1) < clw) | ||
987 | { | ||
988 | #ifdef HAVE_PIXMAN | ||
989 | # ifdef PIXMAN_LINE | ||
990 | alpha_data_buffer = aa; | ||
991 | aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, | ||
992 | (uint32_t *)&alpha_data_buffer, 4); | ||
993 | |||
994 | if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
995 | (!dc->mask.mask)) | ||
996 | pixman_image_composite(PIXMAN_OP_OVER, | ||
997 | dc->col.pixman_color_image, | ||
998 | aa_mask_image, dst->pixman.im, | ||
999 | pix_x + 1, pix_y, 0, 0, | ||
1000 | pix_x + 1, pix_y, 1, 1); | ||
1001 | else if ((dst->pixman.im) && (dc->col.pixman_color_image) && | ||
1002 | (dc->mask.mask)) | ||
1003 | pixman_image_composite(op, dc->col.pixman_color_image, | ||
1004 | dc->mask.mask->pixman.im, | ||
1005 | dst->pixman.im, | ||
1006 | pix_x + 1, pix_y, 0, 0, | ||
1007 | pix_x + 1, pix_y, 1, 1); | ||
1008 | else | ||
1009 | # endif | ||
1010 | #endif | ||
1011 | pfunc(0, aa, color, p + 1); | ||
1012 | #ifdef HAVE_PIXMAN | ||
1013 | # ifdef PIXMAN_LINE | ||
1014 | pixman_image_unref(aa_mask_image); | ||
1015 | # endif | ||
1016 | #endif | ||
1017 | } | ||
1018 | } | ||
673 | next_y: | 1019 | next_y: |
674 | xx += dxx; | 1020 | xx += dxx; |
675 | py++; | 1021 | py++; |
676 | p += dstw; | 1022 | p += dstw; |
1023 | #ifdef HAVE_PIXMAN | ||
1024 | # ifdef PIXMAN_LINE | ||
1025 | pix_y += pix_y_unit; | ||
1026 | # endif | ||
1027 | #endif | ||
677 | } | 1028 | } |
678 | } | 1029 | } |