src/video/SDL_blit_N.c
changeset 2267 c785543d1843
parent 2262 bee005ace1bf
child 2698 e1da92da346c
     1.1 --- a/src/video/SDL_blit_N.c	Sat Aug 18 01:44:21 2007 +0000
     1.2 +++ b/src/video/SDL_blit_N.c	Sat Aug 18 05:39:09 2007 +0000
     1.3 @@ -160,9 +160,9 @@
     1.4  {
     1.5      int height = info->dst_h;
     1.6      Uint8 *src = (Uint8 *) info->src;
     1.7 -    int srcskip = info->s_skip;
     1.8 +    int srcskip = info->src_skip;
     1.9      Uint8 *dst = (Uint8 *) info->dst;
    1.10 -    int dstskip = info->dst_pitch;
    1.11 +    int dstskip = info->dst_skip;
    1.12      SDL_PixelFormat *srcfmt = info->src;
    1.13      vector unsigned char valpha = vec_splat_u8(0);
    1.14      vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
    1.15 @@ -264,9 +264,9 @@
    1.16  {
    1.17      int height = info->dst_h;
    1.18      Uint8 *src = (Uint8 *) info->src;
    1.19 -    int srcskip = info->s_skip;
    1.20 +    int srcskip = info->src_skip;
    1.21      Uint8 *dst = (Uint8 *) info->dst;
    1.22 -    int dstskip = info->dst_pitch;
    1.23 +    int dstskip = info->dst_skip;
    1.24      SDL_PixelFormat *srcfmt = info->src;
    1.25      SDL_PixelFormat *dstfmt = info->dst;
    1.26      unsigned alpha;
    1.27 @@ -322,8 +322,8 @@
    1.28      vf800 = (vector unsigned short) vec_splat_u8(-7);
    1.29      vf800 = vec_sl(vf800, vec_splat_u16(8));
    1.30  
    1.31 -    if (dstfmt->Amask && (info->cmod >> 24)) {
    1.32 -        ((unsigned char *) &valpha)[0] = alpha = (info->cmod >> 24);
    1.33 +    if (dstfmt->Amask && info->a) {
    1.34 +        ((unsigned char *) &valpha)[0] = alpha = info->a;
    1.35          valpha = vec_splat(valpha, 0);
    1.36      } else {
    1.37          alpha = 0;
    1.38 @@ -412,9 +412,9 @@
    1.39  {
    1.40      int height = info->dst_h;
    1.41      Uint8 *src = (Uint8 *) info->src;
    1.42 -    int srcskip = info->s_skip;
    1.43 +    int srcskip = info->src_skip;
    1.44      Uint8 *dst = (Uint8 *) info->dst;
    1.45 -    int dstskip = info->dst_pitch;
    1.46 +    int dstskip = info->dst_skip;
    1.47      SDL_PixelFormat *srcfmt = info->src;
    1.48      SDL_PixelFormat *dstfmt = info->dst;
    1.49      unsigned alpha;
    1.50 @@ -470,8 +470,8 @@
    1.51      vf800 = (vector unsigned short) vec_splat_u8(-7);
    1.52      vf800 = vec_sl(vf800, vec_splat_u16(8));
    1.53  
    1.54 -    if (dstfmt->Amask && (info->cmod >> 24)) {
    1.55 -        ((unsigned char *) &valpha)[0] = alpha = (info->cmod >> 24);
    1.56 +    if (dstfmt->Amask && info->a) {
    1.57 +        ((unsigned char *) &valpha)[0] = alpha = info->a;
    1.58          valpha = vec_splat(valpha, 0);
    1.59      } else {
    1.60          alpha = 0;
    1.61 @@ -561,17 +561,17 @@
    1.62  {
    1.63      int height = info->dst_h;
    1.64      Uint32 *srcp = (Uint32 *) info->src;
    1.65 -    int srcskip = info->s_skip;
    1.66 +    int srcskip = info->src_skip;
    1.67      Uint32 *dstp = (Uint32 *) info->dst;
    1.68 -    int dstskip = info->dst_pitch;
    1.69 +    int dstskip = info->dst_skip;
    1.70      SDL_PixelFormat *srcfmt = info->src;
    1.71      int srcbpp = srcfmt->BytesPerPixel;
    1.72      SDL_PixelFormat *dstfmt = info->dst;
    1.73      int dstbpp = dstfmt->BytesPerPixel;
    1.74      int copy_alpha = (srcfmt->Amask && dstfmt->Amask);
    1.75 -    unsigned alpha = dstfmt->Amask ? (info->cmod >> 24) : 0;
    1.76 +    unsigned alpha = dstfmt->Amask ? info->a : 0;
    1.77      Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
    1.78 -    Uint32 ckey = info->ckey;
    1.79 +    Uint32 ckey = info->colorkey;
    1.80      vector unsigned int valpha;
    1.81      vector unsigned char vpermute;
    1.82      vector unsigned char vzero;
    1.83 @@ -679,17 +679,17 @@
    1.84  {
    1.85      int height = info->dst_h;
    1.86      Uint32 *src = (Uint32 *) info->src;
    1.87 -    int srcskip = info->s_skip;
    1.88 +    int srcskip = info->src_skip;
    1.89      Uint32 *dst = (Uint32 *) info->dst;
    1.90 -    int dstskip = info->dst_pitch;
    1.91 +    int dstskip = info->dst_skip;
    1.92      SDL_PixelFormat *srcfmt = info->src;
    1.93      SDL_PixelFormat *dstfmt = info->dst;
    1.94      vector unsigned int vzero = vec_splat_u32(0);
    1.95      vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
    1.96      if (dstfmt->Amask && !srcfmt->Amask) {
    1.97 -        if ((info->cmod >> 24)) {
    1.98 +        if (info->a) {
    1.99              vector unsigned char valpha;
   1.100 -            ((unsigned char *) &valpha)[0] = (info->cmod >> 24);
   1.101 +            ((unsigned char *) &valpha)[0] = info->a;
   1.102              vzero = (vector unsigned int) vec_splat(valpha, 0);
   1.103          }
   1.104      }
   1.105 @@ -758,17 +758,17 @@
   1.106  
   1.107      int height = info->dst_h;
   1.108      Uint32 *src = (Uint32 *) info->src;
   1.109 -    int srcskip = info->s_skip;
   1.110 +    int srcskip = info->src_skip;
   1.111      Uint32 *dst = (Uint32 *) info->dst;
   1.112 -    int dstskip = info->dst_pitch;
   1.113 +    int dstskip = info->dst_skip;
   1.114      SDL_PixelFormat *srcfmt = info->src;
   1.115      SDL_PixelFormat *dstfmt = info->dst;
   1.116      vector unsigned int vzero = vec_splat_u32(0);
   1.117      vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
   1.118      if (dstfmt->Amask && !srcfmt->Amask) {
   1.119 -        if ((info->cmod >> 24)) {
   1.120 +        if (info->a) {
   1.121              vector unsigned char valpha;
   1.122 -            ((unsigned char *) &valpha)[0] = (info->cmod >> 24);
   1.123 +            ((unsigned char *) &valpha)[0] = info->a;
   1.124              vzero = (vector unsigned int) vec_splat(valpha, 0);
   1.125          }
   1.126      }
   1.127 @@ -901,9 +901,9 @@
   1.128      width = info->dst_w;
   1.129      height = info->dst_h;
   1.130      src = (Uint32 *) info->src;
   1.131 -    srcskip = info->s_skip / 4;
   1.132 +    srcskip = info->src_skip / 4;
   1.133      dst = info->dst;
   1.134 -    dstskip = info->dst_pitch;
   1.135 +    dstskip = info->dst_skip;
   1.136      map = info->table;
   1.137  
   1.138      if (map == NULL) {
   1.139 @@ -1018,9 +1018,9 @@
   1.140      width = info->dst_w;
   1.141      height = info->dst_h;
   1.142      src = (Uint32 *) info->src;
   1.143 -    srcskip = info->s_skip / 4;
   1.144 +    srcskip = info->src_skip / 4;
   1.145      dst = (Uint16 *) info->dst;
   1.146 -    dstskip = info->dst_pitch / 2;
   1.147 +    dstskip = info->dst_skip / 2;
   1.148  
   1.149  #ifdef USE_DUFFS_LOOP
   1.150      while (height--) {
   1.151 @@ -1142,9 +1142,9 @@
   1.152      width = info->dst_w;
   1.153      height = info->dst_h;
   1.154      src = (Uint32 *) info->src;
   1.155 -    srcskip = info->s_skip / 4;
   1.156 +    srcskip = info->src_skip / 4;
   1.157      dst = (Uint16 *) info->dst;
   1.158 -    dstskip = info->dst_pitch / 2;
   1.159 +    dstskip = info->dst_skip / 2;
   1.160  
   1.161  #ifdef USE_DUFFS_LOOP
   1.162      while (height--) {
   1.163 @@ -1255,9 +1255,9 @@
   1.164      width = info->dst_w;
   1.165      height = info->dst_h;
   1.166      src = (Uint8 *) info->src;
   1.167 -    srcskip = info->s_skip;
   1.168 +    srcskip = info->src_skip;
   1.169      dst = (Uint32 *) info->dst;
   1.170 -    dstskip = info->dst_pitch / 4;
   1.171 +    dstskip = info->dst_skip / 4;
   1.172  
   1.173  #ifdef USE_DUFFS_LOOP
   1.174      while (height--) {
   1.175 @@ -1877,9 +1877,9 @@
   1.176      width = info->dst_w;
   1.177      height = info->dst_h;
   1.178      src = (Uint32 *) info->src;
   1.179 -    srcskip = info->s_skip / 4;
   1.180 +    srcskip = info->src_skip / 4;
   1.181      dst = info->dst;
   1.182 -    dstskip = info->dst_pitch;
   1.183 +    dstskip = info->dst_skip;
   1.184      map = info->table;
   1.185  
   1.186  #ifdef USE_DUFFS_LOOP
   1.187 @@ -1950,11 +1950,11 @@
   1.188      width = info->dst_w;
   1.189      height = info->dst_h;
   1.190      src = info->src;
   1.191 -    srcskip = info->s_skip;
   1.192 +    srcskip = info->src_skip;
   1.193      dst = info->dst;
   1.194 -    dstskip = info->dst_pitch;
   1.195 +    dstskip = info->dst_skip;
   1.196      map = info->table;
   1.197 -    srcfmt = info->src;
   1.198 +    srcfmt = info->src_fmt;
   1.199      srcbpp = srcfmt->BytesPerPixel;
   1.200  
   1.201      if (map == NULL) {
   1.202 @@ -2031,15 +2031,15 @@
   1.203      int width = info->dst_w;
   1.204      int height = info->dst_h;
   1.205      Uint32 *src = (Uint32 *) info->src;
   1.206 -    int srcskip = info->s_skip;
   1.207 +    int srcskip = info->src_skip;
   1.208      Uint32 *dst = (Uint32 *) info->dst;
   1.209 -    int dstskip = info->dst_pitch;
   1.210 -    SDL_PixelFormat *srcfmt = info->src;
   1.211 -    SDL_PixelFormat *dstfmt = info->dst;
   1.212 +    int dstskip = info->dst_skip;
   1.213 +    SDL_PixelFormat *srcfmt = info->src_fmt;
   1.214 +    SDL_PixelFormat *dstfmt = info->dst_fmt;
   1.215  
   1.216      if (dstfmt->Amask) {
   1.217          /* RGB->RGBA, SET_ALPHA */
   1.218 -        Uint32 mask = ((info->cmod >> 24) >> dstfmt->Aloss) << dstfmt->Ashift;
   1.219 +        Uint32 mask = (info->a >> dstfmt->Aloss) << dstfmt->Ashift;
   1.220  
   1.221          while (height--) {
   1.222  			/* *INDENT-OFF* */
   1.223 @@ -2080,14 +2080,14 @@
   1.224      int width = info->dst_w;
   1.225      int height = info->dst_h;
   1.226      Uint8 *src = info->src;
   1.227 -    int srcskip = info->s_skip;
   1.228 +    int srcskip = info->src_skip;
   1.229      Uint8 *dst = info->dst;
   1.230 -    int dstskip = info->dst_pitch;
   1.231 -    SDL_PixelFormat *srcfmt = info->src;
   1.232 +    int dstskip = info->dst_skip;
   1.233 +    SDL_PixelFormat *srcfmt = info->src_fmt;
   1.234      int srcbpp = srcfmt->BytesPerPixel;
   1.235 -    SDL_PixelFormat *dstfmt = info->dst;
   1.236 +    SDL_PixelFormat *dstfmt = info->dst_fmt;
   1.237      int dstbpp = dstfmt->BytesPerPixel;
   1.238 -    unsigned alpha = dstfmt->Amask ? (info->cmod >> 24) : 0;
   1.239 +    unsigned alpha = dstfmt->Amask ? info->a : 0;
   1.240  
   1.241      while (height--) {
   1.242  		/* *INDENT-OFF* */
   1.243 @@ -2115,12 +2115,12 @@
   1.244      int width = info->dst_w;
   1.245      int height = info->dst_h;
   1.246      Uint8 *src = info->src;
   1.247 -    int srcskip = info->s_skip;
   1.248 +    int srcskip = info->src_skip;
   1.249      Uint8 *dst = info->dst;
   1.250 -    int dstskip = info->dst_pitch;
   1.251 -    SDL_PixelFormat *srcfmt = info->src;
   1.252 +    int dstskip = info->dst_skip;
   1.253 +    SDL_PixelFormat *srcfmt = info->src_fmt;
   1.254      int srcbpp = srcfmt->BytesPerPixel;
   1.255 -    SDL_PixelFormat *dstfmt = info->dst;
   1.256 +    SDL_PixelFormat *dstfmt = info->dst_fmt;
   1.257      int dstbpp = dstfmt->BytesPerPixel;
   1.258      int c;
   1.259  
   1.260 @@ -2145,12 +2145,12 @@
   1.261      int width = info->dst_w;
   1.262      int height = info->dst_h;
   1.263      Uint8 *src = info->src;
   1.264 -    int srcskip = info->s_skip;
   1.265 +    int srcskip = info->src_skip;
   1.266      Uint8 *dst = info->dst;
   1.267 -    int dstskip = info->dst_pitch;
   1.268 -    SDL_PixelFormat *srcfmt = info->src;
   1.269 +    int dstskip = info->dst_skip;
   1.270 +    SDL_PixelFormat *srcfmt = info->src_fmt;
   1.271      const Uint8 *palmap = info->table;
   1.272 -    Uint32 ckey = info->ckey;
   1.273 +    Uint32 ckey = info->colorkey;
   1.274      Uint32 rgbmask = ~srcfmt->Amask;
   1.275      int srcbpp;
   1.276      Uint32 Pixel;
   1.277 @@ -2211,11 +2211,11 @@
   1.278      int width = info->dst_w;
   1.279      int height = info->dst_h;
   1.280      Uint16 *srcp = (Uint16 *) info->src;
   1.281 -    int srcskip = info->s_skip;
   1.282 +    int srcskip = info->src_skip;
   1.283      Uint16 *dstp = (Uint16 *) info->dst;
   1.284 -    int dstskip = info->dst_pitch;
   1.285 -    Uint32 ckey = info->ckey;
   1.286 -    Uint32 rgbmask = ~info->src->Amask;
   1.287 +    int dstskip = info->dst_skip;
   1.288 +    Uint32 ckey = info->colorkey;
   1.289 +    Uint32 rgbmask = ~info->src_fmt->Amask;
   1.290  
   1.291      /* Set up some basic variables */
   1.292      srcskip /= 2;
   1.293 @@ -2245,15 +2245,15 @@
   1.294      int width = info->dst_w;
   1.295      int height = info->dst_h;
   1.296      Uint8 *src = info->src;
   1.297 -    int srcskip = info->s_skip;
   1.298 +    int srcskip = info->src_skip;
   1.299      Uint8 *dst = info->dst;
   1.300 -    int dstskip = info->dst_pitch;
   1.301 -    Uint32 ckey = info->ckey;
   1.302 -    SDL_PixelFormat *srcfmt = info->src;
   1.303 -    SDL_PixelFormat *dstfmt = info->dst;
   1.304 +    int dstskip = info->dst_skip;
   1.305 +    Uint32 ckey = info->colorkey;
   1.306 +    SDL_PixelFormat *srcfmt = info->src_fmt;
   1.307 +    SDL_PixelFormat *dstfmt = info->dst_fmt;
   1.308      int srcbpp = srcfmt->BytesPerPixel;
   1.309      int dstbpp = dstfmt->BytesPerPixel;
   1.310 -    unsigned alpha = dstfmt->Amask ? (info->cmod >> 24) : 0;
   1.311 +    unsigned alpha = dstfmt->Amask ? info->a : 0;
   1.312      Uint32 rgbmask = ~srcfmt->Amask;
   1.313  
   1.314      /* Set up some basic variables */
   1.315 @@ -2288,12 +2288,12 @@
   1.316      int width = info->dst_w;
   1.317      int height = info->dst_h;
   1.318      Uint8 *src = info->src;
   1.319 -    int srcskip = info->s_skip;
   1.320 +    int srcskip = info->src_skip;
   1.321      Uint8 *dst = info->dst;
   1.322 -    int dstskip = info->dst_pitch;
   1.323 -    Uint32 ckey = info->ckey;
   1.324 -    SDL_PixelFormat *srcfmt = info->src;
   1.325 -    SDL_PixelFormat *dstfmt = info->dst;
   1.326 +    int dstskip = info->dst_skip;
   1.327 +    Uint32 ckey = info->colorkey;
   1.328 +    SDL_PixelFormat *srcfmt = info->src_fmt;
   1.329 +    SDL_PixelFormat *dstfmt = info->dst_fmt;
   1.330      Uint32 rgbmask = ~srcfmt->Amask;
   1.331  
   1.332      Uint8 srcbpp;
   1.333 @@ -2332,7 +2332,7 @@
   1.334      int dstbpp;
   1.335      Uint32 dstR, dstG, dstB;
   1.336      Uint32 blit_features;
   1.337 -    SDL_loblit blitfunc;
   1.338 +    SDL_BlitFunc blitfunc;
   1.339      enum
   1.340      { NO_ALPHA = 1, SET_ALPHA = 2, COPY_ALPHA = 4 } alpha;
   1.341  };
   1.342 @@ -2403,30 +2403,77 @@
   1.343  /* Mask matches table, or table entry is zero */
   1.344  #define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000))
   1.345  
   1.346 -SDL_loblit
   1.347 -SDL_CalculateBlitN(SDL_Surface * surface, int blit_index)
   1.348 +SDL_BlitFunc
   1.349 +SDL_CalculateBlitN(SDL_Surface * surface)
   1.350  {
   1.351      SDL_PixelFormat *srcfmt;
   1.352      SDL_PixelFormat *dstfmt;
   1.353      const struct blit_table *table;
   1.354      int which;
   1.355 -    SDL_loblit blitfun;
   1.356 +    SDL_BlitFunc blitfun;
   1.357  
   1.358      /* Set up data for choosing the blit */
   1.359      srcfmt = surface->format;
   1.360      dstfmt = surface->map->dst->format;
   1.361  
   1.362 -    if (blit_index & 2) {
   1.363 -        /* alpha or alpha+colorkey */
   1.364 -        return SDL_CalculateAlphaBlit(surface, blit_index);
   1.365 -    }
   1.366 -
   1.367      /* We don't support destinations less than 8-bits */
   1.368      if (dstfmt->BitsPerPixel < 8) {
   1.369          return (NULL);
   1.370      }
   1.371  
   1.372 -    if (blit_index == 1) {
   1.373 +    switch (surface->map->info.flags) {
   1.374 +    case 0:
   1.375 +        blitfun = NULL;
   1.376 +        if (dstfmt->BitsPerPixel == 8) {
   1.377 +            /* We assume 8-bit destinations are palettized */
   1.378 +            if ((srcfmt->BytesPerPixel == 4) &&
   1.379 +                (srcfmt->Rmask == 0x00FF0000) &&
   1.380 +                (srcfmt->Gmask == 0x0000FF00) &&
   1.381 +                (srcfmt->Bmask == 0x000000FF)) {
   1.382 +                if (surface->map->info.table) {
   1.383 +                    blitfun = Blit_RGB888_index8_map;
   1.384 +                } else {
   1.385 +                    blitfun = Blit_RGB888_index8;
   1.386 +                }
   1.387 +            } else {
   1.388 +                blitfun = BlitNto1;
   1.389 +            }
   1.390 +        } else {
   1.391 +            /* Now the meat, choose the blitter we want */
   1.392 +            int a_need = NO_ALPHA;
   1.393 +            if (dstfmt->Amask)
   1.394 +                a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
   1.395 +            table = normal_blit[srcfmt->BytesPerPixel - 1];
   1.396 +            for (which = 0; table[which].dstbpp; ++which) {
   1.397 +                if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
   1.398 +                    MASKOK(srcfmt->Gmask, table[which].srcG) &&
   1.399 +                    MASKOK(srcfmt->Bmask, table[which].srcB) &&
   1.400 +                    MASKOK(dstfmt->Rmask, table[which].dstR) &&
   1.401 +                    MASKOK(dstfmt->Gmask, table[which].dstG) &&
   1.402 +                    MASKOK(dstfmt->Bmask, table[which].dstB) &&
   1.403 +                    dstfmt->BytesPerPixel == table[which].dstbpp &&
   1.404 +                    (a_need & table[which].alpha) == a_need &&
   1.405 +                    ((table[which].blit_features & GetBlitFeatures()) ==
   1.406 +                     table[which].blit_features))
   1.407 +                    break;
   1.408 +            }
   1.409 +            blitfun = table[which].blitfunc;
   1.410 +
   1.411 +            if (blitfun == BlitNtoN) {  /* default C fallback catch-all. Slow! */
   1.412 +                /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
   1.413 +                if (srcfmt->BytesPerPixel == 4 && dstfmt->BytesPerPixel == 4
   1.414 +                    && srcfmt->Rmask == dstfmt->Rmask
   1.415 +                    && srcfmt->Gmask == dstfmt->Gmask
   1.416 +                    && srcfmt->Bmask == dstfmt->Bmask) {
   1.417 +                    blitfun = Blit4to4MaskAlpha;
   1.418 +                } else if (a_need == COPY_ALPHA) {
   1.419 +                    blitfun = BlitNtoNCopyAlpha;
   1.420 +                }
   1.421 +            }
   1.422 +        }
   1.423 +        return (blitfun);
   1.424 +
   1.425 +    case SDL_COPY_COLORKEY:
   1.426          /* colorkey blit: Here we don't have too many options, mostly
   1.427             because RLE is the preferred fast way to deal with this.
   1.428             If a particular case turns out to be useful we'll add it. */
   1.429 @@ -2442,70 +2489,15 @@
   1.430                  return Blit32to32KeyAltivec;
   1.431              } else
   1.432  #endif
   1.433 -
   1.434 -            if (srcfmt->Amask && dstfmt->Amask)
   1.435 +            if (srcfmt->Amask && dstfmt->Amask) {
   1.436                  return BlitNtoNKeyCopyAlpha;
   1.437 -            else
   1.438 +            } else {
   1.439                  return BlitNtoNKey;
   1.440 -        }
   1.441 -    }
   1.442 -
   1.443 -    blitfun = NULL;
   1.444 -    if (dstfmt->BitsPerPixel == 8) {
   1.445 -        /* We assume 8-bit destinations are palettized */
   1.446 -        if ((srcfmt->BytesPerPixel == 4) &&
   1.447 -            (srcfmt->Rmask == 0x00FF0000) &&
   1.448 -            (srcfmt->Gmask == 0x0000FF00) && (srcfmt->Bmask == 0x000000FF)) {
   1.449 -            if (surface->map->table) {
   1.450 -                blitfun = Blit_RGB888_index8_map;
   1.451 -            } else {
   1.452 -                blitfun = Blit_RGB888_index8;
   1.453 -            }
   1.454 -        } else {
   1.455 -            blitfun = BlitNto1;
   1.456 -        }
   1.457 -    } else {
   1.458 -        /* Now the meat, choose the blitter we want */
   1.459 -        int a_need = NO_ALPHA;
   1.460 -        if (dstfmt->Amask)
   1.461 -            a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
   1.462 -        table = normal_blit[srcfmt->BytesPerPixel - 1];
   1.463 -        for (which = 0; table[which].dstbpp; ++which) {
   1.464 -            if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
   1.465 -                MASKOK(srcfmt->Gmask, table[which].srcG) &&
   1.466 -                MASKOK(srcfmt->Bmask, table[which].srcB) &&
   1.467 -                MASKOK(dstfmt->Rmask, table[which].dstR) &&
   1.468 -                MASKOK(dstfmt->Gmask, table[which].dstG) &&
   1.469 -                MASKOK(dstfmt->Bmask, table[which].dstB) &&
   1.470 -                dstfmt->BytesPerPixel == table[which].dstbpp &&
   1.471 -                (a_need & table[which].alpha) == a_need &&
   1.472 -                ((table[which].blit_features & GetBlitFeatures()) ==
   1.473 -                 table[which].blit_features))
   1.474 -                break;
   1.475 -        }
   1.476 -        blitfun = table[which].blitfunc;
   1.477 -
   1.478 -        if (blitfun == BlitNtoN) {      /* default C fallback catch-all. Slow! */
   1.479 -            /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
   1.480 -            if (srcfmt->BytesPerPixel == 4 && dstfmt->BytesPerPixel == 4 &&
   1.481 -                srcfmt->Rmask == dstfmt->Rmask &&
   1.482 -                srcfmt->Gmask == dstfmt->Gmask &&
   1.483 -                srcfmt->Bmask == dstfmt->Bmask) {
   1.484 -                blitfun = Blit4to4MaskAlpha;
   1.485 -            } else if (a_need == COPY_ALPHA) {
   1.486 -                blitfun = BlitNtoNCopyAlpha;
   1.487              }
   1.488          }
   1.489      }
   1.490  
   1.491 -#ifdef DEBUG_ASM
   1.492 -    if ((blitfun == BlitNtoN) || (blitfun == BlitNto1))
   1.493 -        fprintf(stderr, "Using C blit\n");
   1.494 -    else
   1.495 -        fprintf(stderr, "Using optimized C blit\n");
   1.496 -#endif /* DEBUG_ASM */
   1.497 -
   1.498 -    return (blitfun);
   1.499 +    return NULL;
   1.500  }
   1.501  
   1.502  /* vi: set ts=4 sw=4 expandtab: */