src/video/SDL_blit_A.c
changeset 2231 a353684c7cc1
parent 2141 e1a70460c354
child 2232 6630fefab312
equal deleted inserted replaced
2230:9b7d29d2432b 2231:a353684c7cc1
  2836             if (df->BytesPerPixel == 1)
  2836             if (df->BytesPerPixel == 1)
  2837                 return BlitNto1SurfaceAlphaKey;
  2837                 return BlitNto1SurfaceAlphaKey;
  2838             else
  2838             else
  2839 #if SDL_ALTIVEC_BLITTERS
  2839 #if SDL_ALTIVEC_BLITTERS
  2840                 if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 &&
  2840                 if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 &&
  2841                     !(surface->map->dst->flags & SDL_HWSURFACE)
  2841                     SDL_HasAltiVec())
  2842                     && SDL_HasAltiVec())
       
  2843                 return Blit32to32SurfaceAlphaKeyAltivec;
  2842                 return Blit32to32SurfaceAlphaKeyAltivec;
  2844             else
  2843             else
  2845 #endif
  2844 #endif
  2846                 return BlitNtoNSurfaceAlphaKey;
  2845                 return BlitNtoNSurfaceAlphaKey;
  2847         } else {
  2846         } else {
  2880                         && sf->Bshift % 8 == 0 && SDL_HasMMX())
  2879                         && sf->Bshift % 8 == 0 && SDL_HasMMX())
  2881                         return BlitRGBtoRGBSurfaceAlphaMMX;
  2880                         return BlitRGBtoRGBSurfaceAlphaMMX;
  2882 #endif
  2881 #endif
  2883                     if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) {
  2882                     if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) {
  2884 #if SDL_ALTIVEC_BLITTERS
  2883 #if SDL_ALTIVEC_BLITTERS
  2885                         if (!(surface->map->dst->flags & SDL_HWSURFACE)
  2884                         if (SDL_HasAltiVec())
  2886                             && SDL_HasAltiVec())
       
  2887                             return BlitRGBtoRGBSurfaceAlphaAltivec;
  2885                             return BlitRGBtoRGBSurfaceAlphaAltivec;
  2888 #endif
  2886 #endif
  2889                         return BlitRGBtoRGBSurfaceAlpha;
  2887                         return BlitRGBtoRGBSurfaceAlpha;
  2890                     }
  2888                     }
  2891                 }
  2889                 }
  2892 #if SDL_ALTIVEC_BLITTERS
  2890 #if SDL_ALTIVEC_BLITTERS
  2893                 if ((sf->BytesPerPixel == 4) &&
  2891                 if ((sf->BytesPerPixel == 4) && SDL_HasAltiVec())
  2894                     !(surface->map->dst->flags & SDL_HWSURFACE)
       
  2895                     && SDL_HasAltiVec())
       
  2896                     return Blit32to32SurfaceAlphaAltivec;
  2892                     return Blit32to32SurfaceAlphaAltivec;
  2897                 else
  2893                 else
  2898 #endif
  2894 #endif
  2899                     return BlitNtoNSurfaceAlpha;
  2895                     return BlitNtoNSurfaceAlpha;
  2900 
  2896 
  2910             return BlitNto1PixelAlpha;
  2906             return BlitNto1PixelAlpha;
  2911 
  2907 
  2912         case 2:
  2908         case 2:
  2913 #if SDL_ALTIVEC_BLITTERS
  2909 #if SDL_ALTIVEC_BLITTERS
  2914             if (sf->BytesPerPixel == 4
  2910             if (sf->BytesPerPixel == 4
  2915                 && !(surface->map->dst->flags & SDL_HWSURFACE)
       
  2916                 && df->Gmask == 0x7e0 && df->Bmask == 0x1f
  2911                 && df->Gmask == 0x7e0 && df->Bmask == 0x1f
  2917                 && SDL_HasAltiVec())
  2912                 && SDL_HasAltiVec())
  2918                 return Blit32to565PixelAlphaAltivec;
  2913                 return Blit32to565PixelAlphaAltivec;
  2919             else
  2914             else
  2920 #endif
  2915 #endif
  2944                         return BlitRGBtoRGBPixelAlphaMMX;
  2939                         return BlitRGBtoRGBPixelAlphaMMX;
  2945                 }
  2940                 }
  2946 #endif
  2941 #endif
  2947                 if (sf->Amask == 0xff000000) {
  2942                 if (sf->Amask == 0xff000000) {
  2948 #if SDL_ALTIVEC_BLITTERS
  2943 #if SDL_ALTIVEC_BLITTERS
  2949                     if (!(surface->map->dst->flags & SDL_HWSURFACE)
  2944                     if (SDL_HasAltiVec())
  2950                         && SDL_HasAltiVec())
       
  2951                         return BlitRGBtoRGBPixelAlphaAltivec;
  2945                         return BlitRGBtoRGBPixelAlphaAltivec;
  2952 #endif
  2946 #endif
  2953                     return BlitRGBtoRGBPixelAlpha;
  2947                     return BlitRGBtoRGBPixelAlpha;
  2954                 }
  2948                 }
  2955             }
  2949             }
  2956 #if SDL_ALTIVEC_BLITTERS
  2950 #if SDL_ALTIVEC_BLITTERS
  2957             if (sf->Amask && sf->BytesPerPixel == 4 &&
  2951             if (sf->Amask && sf->BytesPerPixel == 4 && SDL_HasAltiVec())
  2958                 !(surface->map->dst->flags & SDL_HWSURFACE)
       
  2959                 && SDL_HasAltiVec())
       
  2960                 return Blit32to32PixelAlphaAltivec;
  2952                 return Blit32to32PixelAlphaAltivec;
  2961             else
  2953             else
  2962 #endif
  2954 #endif
  2963                 return BlitNtoNPixelAlpha;
  2955                 return BlitNtoNPixelAlpha;
  2964 
  2956