summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_draw_main.c
diff options
context:
space:
mode:
authorrbdpngn <rbdpngn>2003-07-20 05:33:11 +0000
committerrbdpngn <rbdpngn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2003-07-20 05:33:11 +0000
commit7af9c3bf45d503858fe6a4281cd5410176fcf7c1 (patch)
tree881fd66f06ce6aec0b0521c9667897e1982270e4 /legacy/evas/src/lib/engines/common/evas_draw_main.c
parentf212675a33193d4f91afe52da69831baaa989470 (diff)
Use the new runtime cpu detection functions to determine the correct drawing
routines. Some stubs for altivec support can be seen here, those are unreachable code paths until the corresponding functions are complete and committed. SVN revision: 7191
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_draw_main.c80
1 files changed, 34 insertions, 46 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 20b1e8d9e3..674ae0a77f 100644
--- a/legacy/evas/src/lib/engines/common/evas_draw_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_draw_main.c
@@ -486,11 +486,6 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
486Gfx_Func_Blend_Src_Dst 486Gfx_Func_Blend_Src_Dst
487evas_common_draw_func_blend_get(RGBA_Image *src, RGBA_Image *dst, int pixels) 487evas_common_draw_func_blend_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
488{ 488{
489#ifdef BUILD_MMX
490 int mmx, sse, sse2;
491
492 evas_common_cpu_can_do(&mmx, &sse, &sse2);
493#endif
494 if (src->flags & RGBA_IMAGE_HAS_ALPHA) 489 if (src->flags & RGBA_IMAGE_HAS_ALPHA)
495 { 490 {
496 if (dst->flags & RGBA_IMAGE_HAS_ALPHA) 491 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
@@ -501,7 +496,7 @@ evas_common_draw_func_blend_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
501 { 496 {
502#ifdef BUILD_MMX 497#ifdef BUILD_MMX
503# ifdef BUILD_C 498# ifdef BUILD_C
504 if (mmx) 499 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
505# endif 500# endif
506 return evas_common_blend_pixels_rgba_to_rgb_mmx; 501 return evas_common_blend_pixels_rgba_to_rgb_mmx;
507# ifdef BUILD_C 502# ifdef BUILD_C
@@ -522,7 +517,7 @@ evas_common_draw_func_blend_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
522 else 517 else
523 { 518 {
524#ifdef BUILD_SSE 519#ifdef BUILD_SSE
525 if ((sse) && (pixels > 256 * 256)) 520 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
526 return evas_common_copy_pixels_rgba_to_rgba_sse; 521 return evas_common_copy_pixels_rgba_to_rgba_sse;
527# ifdef BUILD_MMX 522# ifdef BUILD_MMX
528 else 523 else
@@ -530,7 +525,7 @@ evas_common_draw_func_blend_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
530#endif 525#endif
531#ifdef BUILD_MMX 526#ifdef BUILD_MMX
532# ifdef BUILD_C 527# ifdef BUILD_C
533 if (mmx) 528 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
534# endif 529# endif
535 return evas_common_copy_pixels_rgba_to_rgba_mmx; 530 return evas_common_copy_pixels_rgba_to_rgba_mmx;
536# ifdef BUILD_C 531# ifdef BUILD_C
@@ -549,11 +544,6 @@ evas_common_draw_func_blend_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
549Gfx_Func_Blend_Color_Dst 544Gfx_Func_Blend_Color_Dst
550evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels) 545evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels)
551{ 546{
552#ifdef BUILD_MMX
553 int mmx, sse, sse2;
554
555 evas_common_cpu_can_do(&mmx, &sse, &sse2);
556#endif
557 if (A_VAL(&src) != 0xff) 547 if (A_VAL(&src) != 0xff)
558 { 548 {
559 if (dst->flags & RGBA_IMAGE_HAS_ALPHA) 549 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
@@ -562,14 +552,21 @@ evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels)
562 } 552 }
563 else 553 else
564 { 554 {
555#ifdef BUILD_ALTIVEC
556 if (evas_common_cpu_has_feature(CPU_FEATURE_ALTIVEC))
557 return evas_common_blend_color_rgba_to_rgb_altivec;
558#endif
565#ifdef BUILD_MMX 559#ifdef BUILD_MMX
566 if (mmx) 560 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
567 return evas_common_blend_color_rgba_to_rgb_mmx; 561 return evas_common_blend_color_rgba_to_rgb_mmx;
568#endif 562#endif
569#ifdef BUILD_C 563#ifdef BUILD_C
570# ifdef BUILD_MMX 564# ifdef BUILD_MMX
571 else 565 else
572# endif 566# endif
567# ifdef BUILD_ALTIVEC
568 else
569# endif
573 return evas_common_blend_color_rgba_to_rgb_c; 570 return evas_common_blend_color_rgba_to_rgb_c;
574#endif 571#endif
575 } 572 }
@@ -583,14 +580,18 @@ evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels)
583 else 580 else
584 { 581 {
585#ifdef BUILD_SSE 582#ifdef BUILD_SSE
586 if ((sse) && (pixels > 256 * 256)) 583 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
587 return evas_common_copy_color_rgba_to_rgba_sse; 584 return evas_common_copy_color_rgba_to_rgba_sse;
588#endif 585#endif
586#ifdef BUILD_ALTIVEC
587 if (evas_common_cpu_has_feature(CPU_FEATURE_ALTIVEC))
588 return evas_common_copy_color_rgba_to_rgba_altivec;
589#endif
589#ifdef BUILD_MMX 590#ifdef BUILD_MMX
590# ifdef BUILD_SSE 591# ifdef BUILD_SSE
591 else 592 else
592# endif 593# endif
593 if (mmx) 594 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
594 return evas_common_copy_color_rgba_to_rgba_mmx; 595 return evas_common_copy_color_rgba_to_rgba_mmx;
595#endif 596#endif
596#ifdef BUILD_C 597#ifdef BUILD_C
@@ -608,11 +609,6 @@ evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels)
608Gfx_Func_Blend_Src_Cmod_Dst 609Gfx_Func_Blend_Src_Cmod_Dst
609evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixels) 610evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
610{ 611{
611#ifdef BUILD_MMX
612 int mmx, sse, sse2;
613
614 evas_common_cpu_can_do(&mmx, &sse, &sse2);
615#endif
616 if (src->flags & RGBA_IMAGE_HAS_ALPHA) 612 if (src->flags & RGBA_IMAGE_HAS_ALPHA)
617 { 613 {
618 if (dst->flags & RGBA_IMAGE_HAS_ALPHA) 614 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
@@ -642,11 +638,6 @@ evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixel
642Gfx_Func_Blend_Src_Mul_Dst 638Gfx_Func_Blend_Src_Mul_Dst
643evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels) 639evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
644{ 640{
645#ifdef BUILD_MMX
646 int mmx, sse, sse2;
647
648 evas_common_cpu_can_do(&mmx, &sse, &sse2);
649#endif
650 if (src->flags & RGBA_IMAGE_HAS_ALPHA) 641 if (src->flags & RGBA_IMAGE_HAS_ALPHA)
651 { 642 {
652 if (dst->flags & RGBA_IMAGE_HAS_ALPHA) 643 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
@@ -656,7 +647,7 @@ evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst
656 else 647 else
657 { 648 {
658#ifdef BUILD_MMX 649#ifdef BUILD_MMX
659 if (mmx) 650 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
660 return evas_common_blend_pixels_mul_color_rgba_to_rgb_mmx; 651 return evas_common_blend_pixels_mul_color_rgba_to_rgb_mmx;
661#endif 652#endif
662#ifdef BUILD_C 653#ifdef BUILD_C
@@ -676,7 +667,7 @@ evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst
676 else 667 else
677 { 668 {
678#ifdef BUILD_MMX 669#ifdef BUILD_MMX
679 if (mmx) 670 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
680 return evas_common_blend_pixels_mul_color_rgba_to_rgb_mmx; 671 return evas_common_blend_pixels_mul_color_rgba_to_rgb_mmx;
681#endif 672#endif
682#ifdef BUILD_C 673#ifdef BUILD_C
@@ -695,11 +686,6 @@ evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst
695Gfx_Func_Blend_Src_Alpha_Mul_Dst 686Gfx_Func_Blend_Src_Alpha_Mul_Dst
696evas_common_draw_func_blend_alpha_get(RGBA_Image *dst) 687evas_common_draw_func_blend_alpha_get(RGBA_Image *dst)
697{ 688{
698#ifdef BUILD_MMX
699 int mmx, sse, sse2;
700
701 evas_common_cpu_can_do(&mmx, &sse, &sse2);
702#endif
703 if (dst->flags & RGBA_IMAGE_HAS_ALPHA) 689 if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
704 { 690 {
705 return evas_common_blend_alpha_color_rgba_to_rgba_c; 691 return evas_common_blend_alpha_color_rgba_to_rgba_c;
@@ -707,15 +693,22 @@ evas_common_draw_func_blend_alpha_get(RGBA_Image *dst)
707 else 693 else
708 { 694 {
709#ifdef BUILD_MMX 695#ifdef BUILD_MMX
710 if (mmx) 696 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
711 return evas_common_blend_alpha_color_rgba_to_rgb_mmx; 697 return evas_common_blend_alpha_color_rgba_to_rgb_mmx;
712#endif 698#endif
699#ifdef BUILD_ALTIVEC
700 if (evas_common_cpu_has_feature(CPU_FEATURE_ALTIVEC))
701 return evas_common_blend_alpha_color_rgba_to_rgb_altivec;
702#endif
713#ifdef BUILD_C 703#ifdef BUILD_C
714# ifdef BUILD_MMX 704# ifdef BUILD_MMX
715 else 705 else
716# endif 706# endif
707# ifdef BUILD_ALTIVEC
708 else
709# endif
717 return evas_common_blend_alpha_color_rgba_to_rgb_c; 710 return evas_common_blend_alpha_color_rgba_to_rgb_c;
718#endif 711#endif
719 } 712 }
720#ifdef BUILD_C 713#ifdef BUILD_C
721 return evas_common_blend_alpha_color_rgba_to_rgba_c; 714 return evas_common_blend_alpha_color_rgba_to_rgba_c;
@@ -727,22 +720,17 @@ evas_common_draw_func_blend_alpha_get(RGBA_Image *dst)
727Gfx_Func_Blend_Src_Dst 720Gfx_Func_Blend_Src_Dst
728evas_common_draw_func_copy_get(int pixels, int reverse) 721evas_common_draw_func_copy_get(int pixels, int reverse)
729{ 722{
730#ifdef BUILD_MMX
731 int mmx, sse, sse2;
732
733 evas_common_cpu_can_do(&mmx, &sse, &sse2);
734#endif
735 if (reverse) 723 if (reverse)
736 { 724 {
737#ifdef BUILD_SSE 725#ifdef BUILD_SSE
738 if ((sse) && (pixels > 256 * 256)) 726 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
739 return evas_common_copy_pixels_rev_rgba_to_rgba_sse; 727 return evas_common_copy_pixels_rev_rgba_to_rgba_sse;
740#endif 728#endif
741#ifdef BUILD_MMX 729#ifdef BUILD_MMX
742# ifdef BUILD_SSE 730# ifdef BUILD_SSE
743 else 731 else
744# endif 732# endif
745 if (mmx) 733 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
746 return evas_common_copy_pixels_rev_rgba_to_rgba_mmx; 734 return evas_common_copy_pixels_rev_rgba_to_rgba_mmx;
747#endif 735#endif
748#ifdef BUILD_C 736#ifdef BUILD_C
@@ -755,14 +743,14 @@ evas_common_draw_func_copy_get(int pixels, int reverse)
755 else 743 else
756 { 744 {
757#ifdef BUILD_SSE 745#ifdef BUILD_SSE
758 if ((sse) && (pixels > 256 * 256)) 746 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE) && (pixels > 256 * 256))
759 return evas_common_copy_pixels_rgba_to_rgba_sse; 747 return evas_common_copy_pixels_rgba_to_rgba_sse;
760#endif 748#endif
761#ifdef BUILD_MMX 749#ifdef BUILD_MMX
762# ifdef BUILD_SSE 750# ifdef BUILD_SSE
763 else 751 else
764# endif 752# endif
765 if (mmx) 753 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
766 return evas_common_copy_pixels_rgba_to_rgba_mmx; 754 return evas_common_copy_pixels_rgba_to_rgba_mmx;
767#endif 755#endif
768#ifdef BUILD_C 756#ifdef BUILD_C