summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_draw_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-12-03 09:27:53 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-12-03 09:27:53 +0000
commit1b272aec90c2b03b4df3906c261bca4917f42cde (patch)
tree02c54ced124b274e2b21890d9ddf266e71044b52 /legacy/evas/src/lib/engines/common/evas_draw_main.c
parent172b0612aae0b8ab9a8acdd6c1ddbcfbc4cecd6d (diff)
joses's gradient work - gradient look nice. one problem jose.. USE BRACKETS!
do NOT depend on order operation precedence. it broke scaling. laos other completely bizarre mmx things were going wrong with mm7 ending up not 0 so i've had to force it to be 0. SVN revision: 18811
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_draw_main.c364
1 files changed, 36 insertions, 328 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_draw_main.c b/legacy/evas/src/lib/engines/common/evas_draw_main.c
index 22548a63e2..fab8cb795a 100644
--- a/legacy/evas/src/lib/engines/common/evas_draw_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_draw_main.c
@@ -3,6 +3,33 @@
3extern const DATA8 _evas_pow_lut[65536]; 3extern const DATA8 _evas_pow_lut[65536];
4 4
5void 5void
6evas_common_init(void)
7{
8 evas_common_cpu_init();
9
10 evas_common_blend_init();
11 evas_common_image_init();
12 evas_common_convert_init();
13 evas_common_scale_init();
14 evas_common_rectangle_init();
15 evas_common_gradient_init();
16 evas_common_polygon_init();
17 evas_common_line_init();
18 evas_common_font_init();
19 evas_common_draw_init();
20 evas_common_tilebuf_init();
21}
22
23void
24evas_common_shutdown(void)
25{
26// evas_common_blend_free_evas_pow_lut();
27 evas_font_dir_cache_free();
28 evas_common_image_line_buffer_free();
29 evas_common_image_cache_free();
30}
31
32void
6evas_common_draw_init(void) 33evas_common_draw_init(void)
7{ 34{
8} 35}
@@ -539,162 +566,16 @@ evas_common_draw_context_cutout_merge(Cutout_Rect *in, Cutout_Rect *merge)
539 return out; 566 return out;
540} 567}
541 568
542Gfx_Func_Blend_Src_Dst 569void
543evas_common_draw_func_blend_get(RGBA_Image *src, RGBA_Image *dst, int pixels) 570evas_common_draw_context_set_anti_alias(RGBA_Draw_Context *dc , unsigned char aa)
544{ 571{
545 if (src->flags & RGBA_IMAGE_HAS_ALPHA) 572 dc->anti_alias = !!aa;
546 {
547 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
548 {
549 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
550 return evas_common_blend_pixels_rgba_to_rgba_c;
551 }
552 else
553 {
554#ifdef BUILD_MMX
555# ifdef BUILD_C
556 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
557# endif
558 return evas_common_blend_pixels_rgba_to_rgb_mmx;
559# ifdef BUILD_C
560 else
561# endif
562#endif
563#ifdef BUILD_C
564 return evas_common_blend_pixels_rgba_to_rgb_c;
565#endif
566 }
567 }
568 else
569 {
570 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
571 {
572 return evas_common_copy_pixels_rgb_to_rgba_c;
573 }
574 else
575 {
576#if 1
577
578# ifdef BUILD_MMX
579# ifdef BUILD_C
580 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
581# endif
582 return evas_common_copy_pixels_rgba_to_rgba_mmx2;
583# ifdef BUILD_SSE
584 else
585# endif
586#endif
587#ifdef BUILD_SSE
588# ifdef BUILD_C
589 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 64 * 64))
590# endif
591 return evas_common_copy_pixels_rgba_to_rgba_sse;
592# ifdef BUILD_MMX
593 else
594# endif
595#endif
596#ifdef BUILD_MMX
597# ifdef BUILD_C
598 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
599# endif
600 return evas_common_copy_pixels_rgba_to_rgba_mmx;
601# ifdef BUILD_C
602 else
603# endif
604#endif
605#ifdef BUILD_C
606 return evas_common_copy_pixels_rgba_to_rgba_c;
607#endif
608
609#else
610
611# ifdef BUILD_SSE
612 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
613 return evas_common_copy_pixels_rgba_to_rgba_sse;
614# ifdef BUILD_MMX
615 else
616# endif
617#endif
618#ifdef BUILD_MMX
619# ifdef BUILD_C
620 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
621# endif
622 return evas_common_copy_pixels_rgba_to_rgba_mmx2;
623# ifdef BUILD_C
624 else if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
625# endif
626 return evas_common_copy_pixels_rgba_to_rgba_mmx;
627# ifdef BUILD_C
628 else
629# endif
630#endif
631#ifdef BUILD_C
632 return evas_common_copy_pixels_rgba_to_rgba_c;
633#endif
634
635#endif
636 }
637 }
638 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
639 return evas_common_blend_pixels_rgba_to_rgba_c;
640 pixels = 0;
641} 573}
642 574
643Gfx_Func_Blend_Color_Dst 575void
644evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels) 576evas_common_draw_context_set_color_interpolation(RGBA_Draw_Context *dc, int color_space)
645{ 577{
646 if (A_VAL(&src) != 0xff) 578 dc->interpolation.color_space = color_space;
647 {
648 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
649 {
650 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
651 return evas_common_blend_color_rgba_to_rgba_c;
652 }
653 else
654 {
655#ifdef BUILD_MMX
656 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
657 return evas_common_blend_color_rgba_to_rgb_mmx;
658#endif
659#ifdef BUILD_C
660# ifdef BUILD_MMX
661 else
662# endif
663 return evas_common_blend_color_rgba_to_rgb_c;
664#endif
665 }
666 }
667 else
668 {
669 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
670 {
671 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
672 return evas_common_copy_color_rgb_to_rgba_c;
673 }
674 else
675 {
676#ifdef BUILD_SSE
677 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 64 * 64))
678 return evas_common_copy_color_rgba_to_rgba_sse;
679#endif
680#ifdef BUILD_MMX
681# ifdef BUILD_SSE
682 else
683# endif
684 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
685 return evas_common_copy_color_rgba_to_rgba_mmx;
686#endif
687#ifdef BUILD_C
688# ifdef BUILD_MMX
689 else
690# endif
691 return evas_common_copy_color_rgba_to_rgba_c;
692#endif
693 }
694 }
695 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
696 return evas_common_blend_color_rgba_to_rgba_c;
697 pixels = 0;
698} 579}
699 580
700Gfx_Func_Blend_Src_Cmod_Dst 581Gfx_Func_Blend_Src_Cmod_Dst
@@ -704,7 +585,7 @@ evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixel
704 { 585 {
705 if (dst->flags & RGBA_IMAGE_HAS_ALPHA) 586 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
706 { 587 {
707 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut(); 588// evas_common_blend_init_evas_pow_lut();
708 return evas_common_blend_pixels_cmod_rgba_to_rgba_c; 589 return evas_common_blend_pixels_cmod_rgba_to_rgba_c;
709 } 590 }
710 else 591 else
@@ -716,7 +597,7 @@ evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixel
716 { 597 {
717 if (dst->flags & RGBA_IMAGE_HAS_ALPHA) 598 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
718 { 599 {
719 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut(); 600// evas_common_blend_init_evas_pow_lut();
720 return evas_common_copy_pixels_cmod_rgb_to_rgba_c; 601 return evas_common_copy_pixels_cmod_rgb_to_rgba_c;
721 } 602 }
722 else 603 else
@@ -724,182 +605,9 @@ evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixel
724 return evas_common_copy_pixels_cmod_rgba_to_rgba_c; 605 return evas_common_copy_pixels_cmod_rgba_to_rgba_c;
725 } 606 }
726 } 607 }
727 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut(); 608// evas_common_blend_init_evas_pow_lut();
728 return evas_common_blend_pixels_cmod_rgba_to_rgba_c; 609 return evas_common_blend_pixels_cmod_rgba_to_rgba_c;
729 pixels = 0; 610 pixels = 0;
730} 611}
731 612
732Gfx_Func_Blend_Src_Mul_Dst
733evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
734{
735 if (src->flags & RGBA_IMAGE_HAS_ALPHA)
736 {
737 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
738 {
739 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
740 return evas_common_blend_pixels_mul_color_rgba_to_rgba_c;
741 }
742 else
743 {
744#ifdef BUILD_MMX
745 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
746 return evas_common_blend_pixels_mul_color_rgba_to_rgb_mmx;
747#endif
748#ifdef BUILD_C
749# ifdef BUILD_MMX
750 else
751# endif
752 return evas_common_blend_pixels_mul_color_rgba_to_rgb_c;
753#endif
754 }
755 }
756 else
757 {
758 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
759 {
760 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
761 return evas_common_blend_pixels_mul_color_rgba_to_rgba_c;
762 }
763 else
764 {
765#ifdef BUILD_MMX
766 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
767 return evas_common_blend_pixels_mul_color_rgba_to_rgb_mmx;
768#endif
769#ifdef BUILD_C
770# ifdef BUILD_MMX
771 else
772# endif
773 return evas_common_blend_pixels_mul_color_rgba_to_rgb_c;
774#endif
775 }
776 }
777 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
778 return evas_common_blend_pixels_mul_color_rgba_to_rgba_c;
779 col = 0;
780 pixels = 0;
781}
782
783Gfx_Func_Blend_Src_Alpha_Mul_Dst
784evas_common_draw_func_blend_alpha_get(RGBA_Image *dst)
785{
786 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
787 {
788 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
789 return evas_common_blend_alpha_color_rgba_to_rgba_c;
790 }
791 else
792 {
793#ifdef BUILD_MMX
794 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
795 return evas_common_blend_alpha_color_rgba_to_rgb_mmx;
796#endif
797#ifdef BUILD_C
798# ifdef BUILD_MMX
799 else
800# endif
801 return evas_common_blend_alpha_color_rgba_to_rgb_c;
802#endif
803 }
804#ifdef BUILD_C
805 return evas_common_blend_alpha_color_rgba_to_rgba_c;
806#else
807 return NULL;
808#endif
809}
810
811Gfx_Func_Blend_Src_Dst
812evas_common_draw_func_copy_get(int pixels, int reverse)
813{
814 if (reverse)
815 {
816#ifdef BUILD_SSE
817 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
818 return evas_common_copy_pixels_rev_rgba_to_rgba_sse;
819#endif
820#ifdef BUILD_MMX
821# ifdef BUILD_SSE
822 else
823# endif
824 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
825 return evas_common_copy_pixels_rev_rgba_to_rgba_mmx;
826#endif
827#ifdef BUILD_C
828# ifdef BUILD_MMX
829 else
830# endif
831 return evas_common_copy_pixels_rev_rgba_to_rgba_c;
832#endif
833 }
834 else
835 {
836#if 1
837
838# ifdef BUILD_MMX
839# ifdef BUILD_C
840 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
841# endif
842 return evas_common_copy_pixels_rgba_to_rgba_mmx2;
843# ifdef BUILD_SSE
844 else
845# endif
846#endif
847#ifdef BUILD_SSE
848# ifdef BUILD_C
849 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 64 * 64))
850# endif
851 return evas_common_copy_pixels_rgba_to_rgba_sse;
852# ifdef BUILD_MMX
853 else
854# endif
855#endif
856#ifdef BUILD_MMX
857# ifdef BUILD_C
858 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
859# endif
860 return evas_common_copy_pixels_rgba_to_rgba_mmx;
861# ifdef BUILD_C
862 else
863# endif
864#endif
865#ifdef BUILD_C
866 return evas_common_copy_pixels_rgba_to_rgba_c;
867#endif
868
869#else
870
871# ifdef BUILD_SSE
872 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
873 return evas_common_copy_pixels_rgba_to_rgba_sse;
874# ifdef BUILD_MMX
875 else
876# endif
877#endif
878#ifdef BUILD_MMX
879# ifdef BUILD_C
880 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
881# endif
882 return evas_common_copy_pixels_rgba_to_rgba_mmx2;
883# ifdef BUILD_C
884 else if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
885# endif
886 return evas_common_copy_pixels_rgba_to_rgba_mmx;
887# ifdef BUILD_C
888 else
889# endif
890#endif
891#ifdef BUILD_C
892 return evas_common_copy_pixels_rgba_to_rgba_c;
893#endif
894
895#endif
896 }
897 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
898#ifdef BUILD_C
899 return evas_common_copy_pixels_rgba_to_rgba_c;
900#else
901 return NULL;
902#endif
903 pixels = 0;
904}
905 613