summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_draw_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2006-05-02 07:28:49 +0000
committerCarsten Haitzler <raster@rasterman.com>2006-05-02 07:28:49 +0000
commit77e35d60a30d786f3e1b0be34fda07a9309d1e19 (patch)
tree092e1288116e3ba91a44f9f7ffb2a88e29a788bb /legacy/evas/src/lib/engines/common/evas_draw_main.c
parent3a6d184758724f5c1c7d494703f866764d1ca8b2 (diff)
jose's software rendering work - slight improvements (about 5-10%). i had to
disable destination alha mmx support for text rendering (mask + color) as it was broken in tests. SVN revision: 22440
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_draw_main.c404
1 files changed, 4 insertions, 400 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 1cc51033e1..b56f968f4f 100644
--- a/legacy/evas/src/lib/engines/common/evas_draw_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_draw_main.c
@@ -1,7 +1,5 @@
1#include "evas_common.h" 1#include "evas_common.h"
2 2
3extern const DATA8 _evas_pow_lut[65536];
4
5void 3void
6evas_common_init(void) 4evas_common_init(void)
7{ 5{
@@ -26,6 +24,7 @@ evas_common_shutdown(void)
26// evas_common_blend_free_evas_pow_lut(); 24// evas_common_blend_free_evas_pow_lut();
27 evas_font_dir_cache_free(); 25 evas_font_dir_cache_free();
28 evas_common_image_line_buffer_free(); 26 evas_common_image_line_buffer_free();
27 evas_common_image_alpha_line_buffer_free();
29 evas_common_image_cache_free(); 28 evas_common_image_cache_free();
30} 29}
31 30
@@ -103,7 +102,6 @@ void
103evas_common_draw_context_set_multiplier(RGBA_Draw_Context *dc, int r, int g, int b, int a) 102evas_common_draw_context_set_multiplier(RGBA_Draw_Context *dc, int r, int g, int b, int a)
104{ 103{
105 dc->mul.use = 1; 104 dc->mul.use = 1;
106 dc->mod.use = 0;
107 R_VAL(&(dc->mul.col)) = (DATA8)r; 105 R_VAL(&(dc->mul.col)) = (DATA8)r;
108 G_VAL(&(dc->mul.col)) = (DATA8)g; 106 G_VAL(&(dc->mul.col)) = (DATA8)g;
109 B_VAL(&(dc->mul.col)) = (DATA8)b; 107 B_VAL(&(dc->mul.col)) = (DATA8)b;
@@ -117,41 +115,6 @@ evas_common_draw_context_unset_multiplier(RGBA_Draw_Context *dc)
117} 115}
118 116
119void 117void
120evas_common_draw_context_set_modifiers(RGBA_Draw_Context *dc, DATA8 *rmod, DATA8 *gmod, DATA8 *bmod, DATA8 *amod)
121{
122 int i;
123
124 dc->mod.use = 1;
125 dc->mul.use = 0;
126 if (rmod) memcpy(dc->mod.r, rmod, sizeof(DATA8) * 256);
127 else
128 {
129 for (i = 0; i < 256; i++) dc->mod.r[i] = (DATA8)i;
130 }
131 if (gmod) memcpy(dc->mod.g, gmod, sizeof(DATA8) * 256);
132 else
133 {
134 for (i = 0; i < 256; i++) dc->mod.g[i] = (DATA8)i;
135 }
136 if (bmod) memcpy(dc->mod.b, bmod, sizeof(DATA8) * 256);
137 else
138 {
139 for (i = 0; i < 256; i++) dc->mod.b[i] = (DATA8)i;
140 }
141 if (amod) memcpy(dc->mod.a, amod, sizeof(DATA8) * 256);
142 else
143 {
144 for (i = 0; i < 256; i++) dc->mod.a[i] = (DATA8)i;
145 }
146}
147
148void
149evas_common_draw_context_ununset_modifiers(RGBA_Draw_Context *dc)
150{
151 dc->mod.use = 0;
152}
153
154void
155evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h) 118evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h)
156{ 119{
157 Cutout_Rect *r; 120 Cutout_Rect *r;
@@ -578,367 +541,8 @@ evas_common_draw_context_set_color_interpolation(RGBA_Draw_Context *dc, int colo
578 dc->interpolation.color_space = color_space; 541 dc->interpolation.color_space = color_space;
579} 542}
580 543
581Gfx_Func_Blend_Src_Dst 544void
582evas_common_draw_func_blend_get(RGBA_Image *src, RGBA_Image *dst, int pixels) 545evas_common_draw_context_set_render_op(RGBA_Draw_Context *dc , int op)
583{
584 if (src->flags & RGBA_IMAGE_HAS_ALPHA)
585 {
586 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
587 {
588 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
589 return evas_common_blend_pixels_rgba_to_rgba_c;
590 }
591 else
592 {
593#ifdef BUILD_MMX
594# ifdef BUILD_C
595 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
596# endif
597 return evas_common_blend_pixels_rgba_to_rgb_mmx;
598# ifdef BUILD_C
599 else
600# endif
601#endif
602#ifdef BUILD_C
603 return evas_common_blend_pixels_rgba_to_rgb_c;
604#endif
605 }
606 }
607 else
608 {
609 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
610 {
611 return evas_common_copy_pixels_rgb_to_rgba_c;
612 }
613 else
614 {
615#if 0
616
617# ifdef BUILD_MMX
618# ifdef BUILD_C
619 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
620# endif
621 return evas_common_copy_pixels_rgba_to_rgba_mmx2;
622# ifdef BUILD_SSE
623 else
624# endif
625# endif
626# ifdef BUILD_SSE
627# ifdef BUILD_C
628 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE))
629# endif
630 return evas_common_copy_pixels_rgba_to_rgba_sse;
631# ifdef BUILD_MMX
632 else
633# endif
634#endif
635#ifdef BUILD_MMX
636# ifdef BUILD_C
637 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
638# endif
639 return evas_common_copy_pixels_rgba_to_rgba_mmx;
640# ifdef BUILD_C
641 else
642# endif
643#endif
644#ifdef BUILD_C
645 return evas_common_copy_pixels_rgba_to_rgba_c;
646#endif
647
648#else
649
650# ifdef BUILD_SSE
651 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE))
652 return evas_common_copy_pixels_rgba_to_rgba_sse;
653# ifdef BUILD_MMX
654 else
655# endif
656# endif
657# ifdef BUILD_MMX
658# ifdef BUILD_C
659 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
660# endif
661 return evas_common_copy_pixels_rgba_to_rgba_mmx2;
662# ifdef BUILD_C
663 else if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
664# endif
665 return evas_common_copy_pixels_rgba_to_rgba_mmx;
666# ifdef BUILD_C
667 else
668# endif
669# endif
670# ifdef BUILD_C
671 return evas_common_copy_pixels_rgba_to_rgba_c;
672# endif
673
674#endif
675 }
676 }
677 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
678 return evas_common_blend_pixels_rgba_to_rgba_c;
679 pixels = 0;
680}
681
682Gfx_Func_Blend_Color_Dst
683evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels)
684{
685 if (A_VAL(&src) != 0xff)
686 {
687 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
688 {
689 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
690 return evas_common_blend_color_rgba_to_rgba_c;
691 }
692 else
693 {
694#ifdef BUILD_MMX
695 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
696 return evas_common_blend_color_rgba_to_rgb_mmx;
697#endif
698#ifdef BUILD_C
699# ifdef BUILD_MMX
700 else
701# endif
702 return evas_common_blend_color_rgba_to_rgb_c;
703#endif
704 }
705 }
706 else
707 {
708 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
709 {
710 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
711 return evas_common_copy_color_rgb_to_rgba_c;
712 }
713 else
714 {
715#ifdef BUILD_SSE
716 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 64 * 64))
717 return evas_common_copy_color_rgba_to_rgba_sse;
718#endif
719#ifdef BUILD_MMX
720# ifdef BUILD_SSE
721 else
722# endif
723 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
724 return evas_common_copy_color_rgba_to_rgba_mmx;
725#endif
726#ifdef BUILD_C
727# ifdef BUILD_MMX
728 else
729# endif
730 return evas_common_copy_color_rgba_to_rgba_c;
731#endif
732 }
733 }
734 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
735 return evas_common_blend_color_rgba_to_rgba_c;
736 pixels = 0;
737}
738
739Gfx_Func_Blend_Src_Cmod_Dst
740evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
741{
742 if (src->flags & RGBA_IMAGE_HAS_ALPHA)
743 {
744 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
745 {
746 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
747 return evas_common_blend_pixels_cmod_rgba_to_rgba_c;
748 }
749 else
750 {
751 return evas_common_blend_pixels_cmod_rgba_to_rgb_c;
752 }
753 }
754 else
755 {
756 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
757 {
758 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
759 return evas_common_copy_pixels_cmod_rgb_to_rgba_c;
760 }
761 else
762 {
763 return evas_common_copy_pixels_cmod_rgba_to_rgba_c;
764 }
765 }
766 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
767 return evas_common_blend_pixels_cmod_rgba_to_rgba_c;
768 pixels = 0;
769}
770
771Gfx_Func_Blend_Src_Mul_Dst
772evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
773{
774 if (src->flags & RGBA_IMAGE_HAS_ALPHA)
775 {
776 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
777 {
778 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
779 return evas_common_blend_pixels_mul_color_rgba_to_rgba_c;
780 }
781 else
782 {
783#ifdef BUILD_MMX
784 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
785 return evas_common_blend_pixels_mul_color_rgba_to_rgb_mmx;
786#endif
787#ifdef BUILD_C
788# ifdef BUILD_MMX
789 else
790# endif
791 return evas_common_blend_pixels_mul_color_rgba_to_rgb_c;
792#endif
793 }
794 }
795 else
796 {
797 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
798 {
799 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
800 return evas_common_blend_pixels_mul_color_rgba_to_rgba_c;
801 }
802 else
803 {
804#ifdef BUILD_MMX
805 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
806 return evas_common_blend_pixels_mul_color_rgba_to_rgb_mmx;
807#endif
808#ifdef BUILD_C
809# ifdef BUILD_MMX
810 else
811# endif
812 return evas_common_blend_pixels_mul_color_rgba_to_rgb_c;
813#endif
814 }
815 }
816 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
817 return evas_common_blend_pixels_mul_color_rgba_to_rgba_c;
818 col = 0;
819 pixels = 0;
820}
821
822Gfx_Func_Blend_Src_Alpha_Mul_Dst
823evas_common_draw_func_blend_alpha_get(RGBA_Image *dst)
824{
825 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
826 {
827 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
828 return evas_common_blend_alpha_color_rgba_to_rgba_c;
829 }
830 else
831 {
832#ifdef BUILD_MMX
833 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
834 return evas_common_blend_alpha_color_rgba_to_rgb_mmx;
835#endif
836#ifdef BUILD_C
837# ifdef BUILD_MMX
838 else
839# endif
840 return evas_common_blend_alpha_color_rgba_to_rgb_c;
841#endif
842 }
843#ifdef BUILD_C
844 return evas_common_blend_alpha_color_rgba_to_rgba_c;
845#else
846 return NULL;
847#endif
848}
849
850Gfx_Func_Blend_Src_Dst
851evas_common_draw_func_copy_get(int pixels, int reverse)
852{ 546{
853 if (reverse) 547 dc->render_op = op;
854 {
855#ifdef BUILD_SSE
856 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
857 return evas_common_copy_pixels_rev_rgba_to_rgba_sse;
858#endif
859#ifdef BUILD_MMX
860# ifdef BUILD_SSE
861 else
862# endif
863 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
864 return evas_common_copy_pixels_rev_rgba_to_rgba_mmx;
865#endif
866#ifdef BUILD_C
867# ifdef BUILD_MMX
868 else
869# endif
870 return evas_common_copy_pixels_rev_rgba_to_rgba_c;
871#endif
872 }
873 else
874 {
875#if 1
876
877# ifdef BUILD_MMX
878# ifdef BUILD_C
879 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
880# endif
881 return evas_common_copy_pixels_rgba_to_rgba_mmx2;
882# ifdef BUILD_SSE
883 else
884# endif
885#endif
886#ifdef BUILD_SSE
887# ifdef BUILD_C
888 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 64 * 64))
889# endif
890 return evas_common_copy_pixels_rgba_to_rgba_sse;
891# ifdef BUILD_MMX
892 else
893# endif
894#endif
895#ifdef BUILD_MMX
896# ifdef BUILD_C
897 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
898# endif
899 return evas_common_copy_pixels_rgba_to_rgba_mmx;
900# ifdef BUILD_C
901 else
902# endif
903#endif
904#ifdef BUILD_C
905 return evas_common_copy_pixels_rgba_to_rgba_c;
906#endif
907
908#else
909
910# ifdef BUILD_SSE
911 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
912 return evas_common_copy_pixels_rgba_to_rgba_sse;
913# ifdef BUILD_MMX
914 else
915# endif
916#endif
917#ifdef BUILD_MMX
918# ifdef BUILD_C
919 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX2))
920# endif
921 return evas_common_copy_pixels_rgba_to_rgba_mmx2;
922# ifdef BUILD_C
923 else if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
924# endif
925 return evas_common_copy_pixels_rgba_to_rgba_mmx;
926# ifdef BUILD_C
927 else
928# endif
929#endif
930#ifdef BUILD_C
931 return evas_common_copy_pixels_rgba_to_rgba_c;
932#endif
933
934#endif
935 }
936 if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
937#ifdef BUILD_C
938 return evas_common_copy_pixels_rgba_to_rgba_c;
939#else
940 return NULL;
941#endif
942 pixels = 0;
943} 548}
944