src/video/SDL_blit_auto.c
changeset 2800 8969da2ef606
parent 2267 c785543d1843
child 2859 99210400e8b9
     1.1 --- a/src/video/SDL_blit_auto.c	Fri Nov 28 20:09:32 2008 +0000
     1.2 +++ b/src/video/SDL_blit_auto.c	Sat Nov 29 00:08:29 2008 +0000
     1.3 @@ -897,6 +897,443 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info)
     1.8 +{
     1.9 +    const int flags = info->flags;
    1.10 +    Uint32 pixel;
    1.11 +    Uint32 R, G, B, A;
    1.12 +    int srcy, srcx;
    1.13 +    int posy, posx;
    1.14 +    int incy, incx;
    1.15 +
    1.16 +    srcy = 0;
    1.17 +    posy = 0;
    1.18 +    incy = (info->src_h << 16) / info->dst_h;
    1.19 +    incx = (info->src_w << 16) / info->dst_w;
    1.20 +
    1.21 +    while (info->dst_h--) {
    1.22 +        Uint32 *src;
    1.23 +        Uint32 *dst = (Uint32 *)info->dst;
    1.24 +        int n = info->dst_w;
    1.25 +        srcx = -1;
    1.26 +        posx = 0x10000L;
    1.27 +        while (posy >= 0x10000L) {
    1.28 +            ++srcy;
    1.29 +            posy -= 0x10000L;
    1.30 +        }
    1.31 +        while (n--) {
    1.32 +            if (posx >= 0x10000L) {
    1.33 +                while (posx >= 0x10000L) {
    1.34 +                    ++srcx;
    1.35 +                    posx -= 0x10000L;
    1.36 +                }
    1.37 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
    1.38 +            }
    1.39 +            pixel = *src;
    1.40 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
    1.41 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
    1.42 +            *dst = pixel;
    1.43 +            posx += incx;
    1.44 +            ++dst;
    1.45 +        }
    1.46 +        posy += incy;
    1.47 +        info->dst += info->dst_pitch;
    1.48 +    }
    1.49 +}
    1.50 +
    1.51 +static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info)
    1.52 +{
    1.53 +    const int flags = info->flags;
    1.54 +    Uint32 srcpixel;
    1.55 +    Uint32 srcR, srcG, srcB, srcA;
    1.56 +    Uint32 dstpixel;
    1.57 +    Uint32 dstR, dstG, dstB, dstA;
    1.58 +
    1.59 +    while (info->dst_h--) {
    1.60 +        Uint32 *src = (Uint32 *)info->src;
    1.61 +        Uint32 *dst = (Uint32 *)info->dst;
    1.62 +        int n = info->dst_w;
    1.63 +        while (n--) {
    1.64 +            srcpixel = *src;
    1.65 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
    1.66 +            dstpixel = *dst;
    1.67 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
    1.68 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
    1.69 +                /* This goes away if we ever use premultiplied alpha */
    1.70 +                if (srcA < 255) {
    1.71 +                    srcR = (srcR * srcA) / 255;
    1.72 +                    srcG = (srcG * srcA) / 255;
    1.73 +                    srcB = (srcB * srcA) / 255;
    1.74 +                }
    1.75 +            }
    1.76 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
    1.77 +            case SDL_COPY_MASK:
    1.78 +                if (srcA) {
    1.79 +                    dstR = srcR;
    1.80 +                    dstG = srcG;
    1.81 +                    dstB = srcB;
    1.82 +                }
    1.83 +                break;
    1.84 +            case SDL_COPY_BLEND:
    1.85 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
    1.86 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
    1.87 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
    1.88 +                break;
    1.89 +            case SDL_COPY_ADD:
    1.90 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
    1.91 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
    1.92 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
    1.93 +                break;
    1.94 +            case SDL_COPY_MOD:
    1.95 +                dstR = (srcR * dstR) / 255;
    1.96 +                dstG = (srcG * dstG) / 255;
    1.97 +                dstB = (srcB * dstB) / 255;
    1.98 +                break;
    1.99 +            }
   1.100 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.101 +            *dst = dstpixel;
   1.102 +            ++src;
   1.103 +            ++dst;
   1.104 +        }
   1.105 +        info->src += info->src_pitch;
   1.106 +        info->dst += info->dst_pitch;
   1.107 +    }
   1.108 +}
   1.109 +
   1.110 +static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
   1.111 +{
   1.112 +    const int flags = info->flags;
   1.113 +    Uint32 srcpixel;
   1.114 +    Uint32 srcR, srcG, srcB, srcA;
   1.115 +    Uint32 dstpixel;
   1.116 +    Uint32 dstR, dstG, dstB, dstA;
   1.117 +    int srcy, srcx;
   1.118 +    int posy, posx;
   1.119 +    int incy, incx;
   1.120 +
   1.121 +    srcy = 0;
   1.122 +    posy = 0;
   1.123 +    incy = (info->src_h << 16) / info->dst_h;
   1.124 +    incx = (info->src_w << 16) / info->dst_w;
   1.125 +
   1.126 +    while (info->dst_h--) {
   1.127 +        Uint32 *src;
   1.128 +        Uint32 *dst = (Uint32 *)info->dst;
   1.129 +        int n = info->dst_w;
   1.130 +        srcx = -1;
   1.131 +        posx = 0x10000L;
   1.132 +        while (posy >= 0x10000L) {
   1.133 +            ++srcy;
   1.134 +            posy -= 0x10000L;
   1.135 +        }
   1.136 +        while (n--) {
   1.137 +            if (posx >= 0x10000L) {
   1.138 +                while (posx >= 0x10000L) {
   1.139 +                    ++srcx;
   1.140 +                    posx -= 0x10000L;
   1.141 +                }
   1.142 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.143 +            }
   1.144 +            srcpixel = *src;
   1.145 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
   1.146 +            dstpixel = *dst;
   1.147 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.148 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.149 +                /* This goes away if we ever use premultiplied alpha */
   1.150 +                if (srcA < 255) {
   1.151 +                    srcR = (srcR * srcA) / 255;
   1.152 +                    srcG = (srcG * srcA) / 255;
   1.153 +                    srcB = (srcB * srcA) / 255;
   1.154 +                }
   1.155 +            }
   1.156 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   1.157 +            case SDL_COPY_MASK:
   1.158 +                if (srcA) {
   1.159 +                    dstR = srcR;
   1.160 +                    dstG = srcG;
   1.161 +                    dstB = srcB;
   1.162 +                }
   1.163 +                break;
   1.164 +            case SDL_COPY_BLEND:
   1.165 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
   1.166 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
   1.167 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
   1.168 +                break;
   1.169 +            case SDL_COPY_ADD:
   1.170 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
   1.171 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
   1.172 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
   1.173 +                break;
   1.174 +            case SDL_COPY_MOD:
   1.175 +                dstR = (srcR * dstR) / 255;
   1.176 +                dstG = (srcG * dstG) / 255;
   1.177 +                dstB = (srcB * dstB) / 255;
   1.178 +                break;
   1.179 +            }
   1.180 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.181 +            *dst = dstpixel;
   1.182 +            posx += incx;
   1.183 +            ++dst;
   1.184 +        }
   1.185 +        posy += incy;
   1.186 +        info->dst += info->dst_pitch;
   1.187 +    }
   1.188 +}
   1.189 +
   1.190 +static void SDL_Blit_RGB888_ARGB8888_Modulate(SDL_BlitInfo *info)
   1.191 +{
   1.192 +    const int flags = info->flags;
   1.193 +    const Uint32 modulateR = info->r;
   1.194 +    const Uint32 modulateG = info->g;
   1.195 +    const Uint32 modulateB = info->b;
   1.196 +    const Uint32 modulateA = info->a;
   1.197 +    Uint32 pixel;
   1.198 +    Uint32 R, G, B, A;
   1.199 +
   1.200 +    while (info->dst_h--) {
   1.201 +        Uint32 *src = (Uint32 *)info->src;
   1.202 +        Uint32 *dst = (Uint32 *)info->dst;
   1.203 +        int n = info->dst_w;
   1.204 +        while (n--) {
   1.205 +            pixel = *src;
   1.206 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
   1.207 +            if (flags & SDL_COPY_MODULATE_COLOR) {
   1.208 +                R = (R * modulateR) / 255;
   1.209 +                G = (G * modulateG) / 255;
   1.210 +                B = (B * modulateB) / 255;
   1.211 +            }
   1.212 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.213 +                A = (A * modulateA) / 255;
   1.214 +            }
   1.215 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.216 +            *dst = pixel;
   1.217 +            ++src;
   1.218 +            ++dst;
   1.219 +        }
   1.220 +        info->src += info->src_pitch;
   1.221 +        info->dst += info->dst_pitch;
   1.222 +    }
   1.223 +}
   1.224 +
   1.225 +static void SDL_Blit_RGB888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
   1.226 +{
   1.227 +    const int flags = info->flags;
   1.228 +    const Uint32 modulateR = info->r;
   1.229 +    const Uint32 modulateG = info->g;
   1.230 +    const Uint32 modulateB = info->b;
   1.231 +    const Uint32 modulateA = info->a;
   1.232 +    Uint32 pixel;
   1.233 +    Uint32 R, G, B, A;
   1.234 +    int srcy, srcx;
   1.235 +    int posy, posx;
   1.236 +    int incy, incx;
   1.237 +
   1.238 +    srcy = 0;
   1.239 +    posy = 0;
   1.240 +    incy = (info->src_h << 16) / info->dst_h;
   1.241 +    incx = (info->src_w << 16) / info->dst_w;
   1.242 +
   1.243 +    while (info->dst_h--) {
   1.244 +        Uint32 *src;
   1.245 +        Uint32 *dst = (Uint32 *)info->dst;
   1.246 +        int n = info->dst_w;
   1.247 +        srcx = -1;
   1.248 +        posx = 0x10000L;
   1.249 +        while (posy >= 0x10000L) {
   1.250 +            ++srcy;
   1.251 +            posy -= 0x10000L;
   1.252 +        }
   1.253 +        while (n--) {
   1.254 +            if (posx >= 0x10000L) {
   1.255 +                while (posx >= 0x10000L) {
   1.256 +                    ++srcx;
   1.257 +                    posx -= 0x10000L;
   1.258 +                }
   1.259 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.260 +            }
   1.261 +            pixel = *src;
   1.262 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
   1.263 +            if (flags & SDL_COPY_MODULATE_COLOR) {
   1.264 +                R = (R * modulateR) / 255;
   1.265 +                G = (G * modulateG) / 255;
   1.266 +                B = (B * modulateB) / 255;
   1.267 +            }
   1.268 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.269 +                A = (A * modulateA) / 255;
   1.270 +            }
   1.271 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.272 +            *dst = pixel;
   1.273 +            posx += incx;
   1.274 +            ++dst;
   1.275 +        }
   1.276 +        posy += incy;
   1.277 +        info->dst += info->dst_pitch;
   1.278 +    }
   1.279 +}
   1.280 +
   1.281 +static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
   1.282 +{
   1.283 +    const int flags = info->flags;
   1.284 +    const Uint32 modulateR = info->r;
   1.285 +    const Uint32 modulateG = info->g;
   1.286 +    const Uint32 modulateB = info->b;
   1.287 +    const Uint32 modulateA = info->a;
   1.288 +    Uint32 srcpixel;
   1.289 +    Uint32 srcR, srcG, srcB, srcA;
   1.290 +    Uint32 dstpixel;
   1.291 +    Uint32 dstR, dstG, dstB, dstA;
   1.292 +
   1.293 +    while (info->dst_h--) {
   1.294 +        Uint32 *src = (Uint32 *)info->src;
   1.295 +        Uint32 *dst = (Uint32 *)info->dst;
   1.296 +        int n = info->dst_w;
   1.297 +        while (n--) {
   1.298 +            srcpixel = *src;
   1.299 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
   1.300 +            dstpixel = *dst;
   1.301 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.302 +            if (flags & SDL_COPY_MODULATE_COLOR) {
   1.303 +                srcR = (srcR * modulateR) / 255;
   1.304 +                srcG = (srcG * modulateG) / 255;
   1.305 +                srcB = (srcB * modulateB) / 255;
   1.306 +            }
   1.307 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.308 +                srcA = (srcA * modulateA) / 255;
   1.309 +            }
   1.310 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.311 +                /* This goes away if we ever use premultiplied alpha */
   1.312 +                if (srcA < 255) {
   1.313 +                    srcR = (srcR * srcA) / 255;
   1.314 +                    srcG = (srcG * srcA) / 255;
   1.315 +                    srcB = (srcB * srcA) / 255;
   1.316 +                }
   1.317 +            }
   1.318 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   1.319 +            case SDL_COPY_MASK:
   1.320 +                if (srcA) {
   1.321 +                    dstR = srcR;
   1.322 +                    dstG = srcG;
   1.323 +                    dstB = srcB;
   1.324 +                }
   1.325 +                break;
   1.326 +            case SDL_COPY_BLEND:
   1.327 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
   1.328 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
   1.329 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
   1.330 +                break;
   1.331 +            case SDL_COPY_ADD:
   1.332 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
   1.333 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
   1.334 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
   1.335 +                break;
   1.336 +            case SDL_COPY_MOD:
   1.337 +                dstR = (srcR * dstR) / 255;
   1.338 +                dstG = (srcG * dstG) / 255;
   1.339 +                dstB = (srcB * dstB) / 255;
   1.340 +                break;
   1.341 +            }
   1.342 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.343 +            *dst = dstpixel;
   1.344 +            ++src;
   1.345 +            ++dst;
   1.346 +        }
   1.347 +        info->src += info->src_pitch;
   1.348 +        info->dst += info->dst_pitch;
   1.349 +    }
   1.350 +}
   1.351 +
   1.352 +static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
   1.353 +{
   1.354 +    const int flags = info->flags;
   1.355 +    const Uint32 modulateR = info->r;
   1.356 +    const Uint32 modulateG = info->g;
   1.357 +    const Uint32 modulateB = info->b;
   1.358 +    const Uint32 modulateA = info->a;
   1.359 +    Uint32 srcpixel;
   1.360 +    Uint32 srcR, srcG, srcB, srcA;
   1.361 +    Uint32 dstpixel;
   1.362 +    Uint32 dstR, dstG, dstB, dstA;
   1.363 +    int srcy, srcx;
   1.364 +    int posy, posx;
   1.365 +    int incy, incx;
   1.366 +
   1.367 +    srcy = 0;
   1.368 +    posy = 0;
   1.369 +    incy = (info->src_h << 16) / info->dst_h;
   1.370 +    incx = (info->src_w << 16) / info->dst_w;
   1.371 +
   1.372 +    while (info->dst_h--) {
   1.373 +        Uint32 *src;
   1.374 +        Uint32 *dst = (Uint32 *)info->dst;
   1.375 +        int n = info->dst_w;
   1.376 +        srcx = -1;
   1.377 +        posx = 0x10000L;
   1.378 +        while (posy >= 0x10000L) {
   1.379 +            ++srcy;
   1.380 +            posy -= 0x10000L;
   1.381 +        }
   1.382 +        while (n--) {
   1.383 +            if (posx >= 0x10000L) {
   1.384 +                while (posx >= 0x10000L) {
   1.385 +                    ++srcx;
   1.386 +                    posx -= 0x10000L;
   1.387 +                }
   1.388 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.389 +            }
   1.390 +            srcpixel = *src;
   1.391 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
   1.392 +            dstpixel = *dst;
   1.393 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.394 +            if (flags & SDL_COPY_MODULATE_COLOR) {
   1.395 +                srcR = (srcR * modulateR) / 255;
   1.396 +                srcG = (srcG * modulateG) / 255;
   1.397 +                srcB = (srcB * modulateB) / 255;
   1.398 +            }
   1.399 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.400 +                srcA = (srcA * modulateA) / 255;
   1.401 +            }
   1.402 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.403 +                /* This goes away if we ever use premultiplied alpha */
   1.404 +                if (srcA < 255) {
   1.405 +                    srcR = (srcR * srcA) / 255;
   1.406 +                    srcG = (srcG * srcA) / 255;
   1.407 +                    srcB = (srcB * srcA) / 255;
   1.408 +                }
   1.409 +            }
   1.410 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   1.411 +            case SDL_COPY_MASK:
   1.412 +                if (srcA) {
   1.413 +                    dstR = srcR;
   1.414 +                    dstG = srcG;
   1.415 +                    dstB = srcB;
   1.416 +                }
   1.417 +                break;
   1.418 +            case SDL_COPY_BLEND:
   1.419 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
   1.420 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
   1.421 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
   1.422 +                break;
   1.423 +            case SDL_COPY_ADD:
   1.424 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
   1.425 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
   1.426 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
   1.427 +                break;
   1.428 +            case SDL_COPY_MOD:
   1.429 +                dstR = (srcR * dstR) / 255;
   1.430 +                dstG = (srcG * dstG) / 255;
   1.431 +                dstB = (srcB * dstB) / 255;
   1.432 +                break;
   1.433 +            }
   1.434 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.435 +            *dst = dstpixel;
   1.436 +            posx += incx;
   1.437 +            ++dst;
   1.438 +        }
   1.439 +        posy += incy;
   1.440 +        info->dst += info->dst_pitch;
   1.441 +    }
   1.442 +}
   1.443 +
   1.444  static void SDL_Blit_BGR888_RGB888_Scale(SDL_BlitInfo *info)
   1.445  {
   1.446      const int flags = info->flags;
   1.447 @@ -1766,6 +2203,443 @@
   1.448      }
   1.449  }
   1.450  
   1.451 +static void SDL_Blit_BGR888_ARGB8888_Scale(SDL_BlitInfo *info)
   1.452 +{
   1.453 +    const int flags = info->flags;
   1.454 +    Uint32 pixel;
   1.455 +    Uint32 R, G, B, A;
   1.456 +    int srcy, srcx;
   1.457 +    int posy, posx;
   1.458 +    int incy, incx;
   1.459 +
   1.460 +    srcy = 0;
   1.461 +    posy = 0;
   1.462 +    incy = (info->src_h << 16) / info->dst_h;
   1.463 +    incx = (info->src_w << 16) / info->dst_w;
   1.464 +
   1.465 +    while (info->dst_h--) {
   1.466 +        Uint32 *src;
   1.467 +        Uint32 *dst = (Uint32 *)info->dst;
   1.468 +        int n = info->dst_w;
   1.469 +        srcx = -1;
   1.470 +        posx = 0x10000L;
   1.471 +        while (posy >= 0x10000L) {
   1.472 +            ++srcy;
   1.473 +            posy -= 0x10000L;
   1.474 +        }
   1.475 +        while (n--) {
   1.476 +            if (posx >= 0x10000L) {
   1.477 +                while (posx >= 0x10000L) {
   1.478 +                    ++srcx;
   1.479 +                    posx -= 0x10000L;
   1.480 +                }
   1.481 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.482 +            }
   1.483 +            pixel = *src;
   1.484 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
   1.485 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.486 +            *dst = pixel;
   1.487 +            posx += incx;
   1.488 +            ++dst;
   1.489 +        }
   1.490 +        posy += incy;
   1.491 +        info->dst += info->dst_pitch;
   1.492 +    }
   1.493 +}
   1.494 +
   1.495 +static void SDL_Blit_BGR888_ARGB8888_Blend(SDL_BlitInfo *info)
   1.496 +{
   1.497 +    const int flags = info->flags;
   1.498 +    Uint32 srcpixel;
   1.499 +    Uint32 srcR, srcG, srcB, srcA;
   1.500 +    Uint32 dstpixel;
   1.501 +    Uint32 dstR, dstG, dstB, dstA;
   1.502 +
   1.503 +    while (info->dst_h--) {
   1.504 +        Uint32 *src = (Uint32 *)info->src;
   1.505 +        Uint32 *dst = (Uint32 *)info->dst;
   1.506 +        int n = info->dst_w;
   1.507 +        while (n--) {
   1.508 +            srcpixel = *src;
   1.509 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
   1.510 +            dstpixel = *dst;
   1.511 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.512 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.513 +                /* This goes away if we ever use premultiplied alpha */
   1.514 +                if (srcA < 255) {
   1.515 +                    srcR = (srcR * srcA) / 255;
   1.516 +                    srcG = (srcG * srcA) / 255;
   1.517 +                    srcB = (srcB * srcA) / 255;
   1.518 +                }
   1.519 +            }
   1.520 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   1.521 +            case SDL_COPY_MASK:
   1.522 +                if (srcA) {
   1.523 +                    dstR = srcR;
   1.524 +                    dstG = srcG;
   1.525 +                    dstB = srcB;
   1.526 +                }
   1.527 +                break;
   1.528 +            case SDL_COPY_BLEND:
   1.529 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
   1.530 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
   1.531 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
   1.532 +                break;
   1.533 +            case SDL_COPY_ADD:
   1.534 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
   1.535 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
   1.536 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
   1.537 +                break;
   1.538 +            case SDL_COPY_MOD:
   1.539 +                dstR = (srcR * dstR) / 255;
   1.540 +                dstG = (srcG * dstG) / 255;
   1.541 +                dstB = (srcB * dstB) / 255;
   1.542 +                break;
   1.543 +            }
   1.544 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.545 +            *dst = dstpixel;
   1.546 +            ++src;
   1.547 +            ++dst;
   1.548 +        }
   1.549 +        info->src += info->src_pitch;
   1.550 +        info->dst += info->dst_pitch;
   1.551 +    }
   1.552 +}
   1.553 +
   1.554 +static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
   1.555 +{
   1.556 +    const int flags = info->flags;
   1.557 +    Uint32 srcpixel;
   1.558 +    Uint32 srcR, srcG, srcB, srcA;
   1.559 +    Uint32 dstpixel;
   1.560 +    Uint32 dstR, dstG, dstB, dstA;
   1.561 +    int srcy, srcx;
   1.562 +    int posy, posx;
   1.563 +    int incy, incx;
   1.564 +
   1.565 +    srcy = 0;
   1.566 +    posy = 0;
   1.567 +    incy = (info->src_h << 16) / info->dst_h;
   1.568 +    incx = (info->src_w << 16) / info->dst_w;
   1.569 +
   1.570 +    while (info->dst_h--) {
   1.571 +        Uint32 *src;
   1.572 +        Uint32 *dst = (Uint32 *)info->dst;
   1.573 +        int n = info->dst_w;
   1.574 +        srcx = -1;
   1.575 +        posx = 0x10000L;
   1.576 +        while (posy >= 0x10000L) {
   1.577 +            ++srcy;
   1.578 +            posy -= 0x10000L;
   1.579 +        }
   1.580 +        while (n--) {
   1.581 +            if (posx >= 0x10000L) {
   1.582 +                while (posx >= 0x10000L) {
   1.583 +                    ++srcx;
   1.584 +                    posx -= 0x10000L;
   1.585 +                }
   1.586 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.587 +            }
   1.588 +            srcpixel = *src;
   1.589 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
   1.590 +            dstpixel = *dst;
   1.591 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.592 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.593 +                /* This goes away if we ever use premultiplied alpha */
   1.594 +                if (srcA < 255) {
   1.595 +                    srcR = (srcR * srcA) / 255;
   1.596 +                    srcG = (srcG * srcA) / 255;
   1.597 +                    srcB = (srcB * srcA) / 255;
   1.598 +                }
   1.599 +            }
   1.600 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   1.601 +            case SDL_COPY_MASK:
   1.602 +                if (srcA) {
   1.603 +                    dstR = srcR;
   1.604 +                    dstG = srcG;
   1.605 +                    dstB = srcB;
   1.606 +                }
   1.607 +                break;
   1.608 +            case SDL_COPY_BLEND:
   1.609 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
   1.610 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
   1.611 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
   1.612 +                break;
   1.613 +            case SDL_COPY_ADD:
   1.614 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
   1.615 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
   1.616 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
   1.617 +                break;
   1.618 +            case SDL_COPY_MOD:
   1.619 +                dstR = (srcR * dstR) / 255;
   1.620 +                dstG = (srcG * dstG) / 255;
   1.621 +                dstB = (srcB * dstB) / 255;
   1.622 +                break;
   1.623 +            }
   1.624 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.625 +            *dst = dstpixel;
   1.626 +            posx += incx;
   1.627 +            ++dst;
   1.628 +        }
   1.629 +        posy += incy;
   1.630 +        info->dst += info->dst_pitch;
   1.631 +    }
   1.632 +}
   1.633 +
   1.634 +static void SDL_Blit_BGR888_ARGB8888_Modulate(SDL_BlitInfo *info)
   1.635 +{
   1.636 +    const int flags = info->flags;
   1.637 +    const Uint32 modulateR = info->r;
   1.638 +    const Uint32 modulateG = info->g;
   1.639 +    const Uint32 modulateB = info->b;
   1.640 +    const Uint32 modulateA = info->a;
   1.641 +    Uint32 pixel;
   1.642 +    Uint32 R, G, B, A;
   1.643 +
   1.644 +    while (info->dst_h--) {
   1.645 +        Uint32 *src = (Uint32 *)info->src;
   1.646 +        Uint32 *dst = (Uint32 *)info->dst;
   1.647 +        int n = info->dst_w;
   1.648 +        while (n--) {
   1.649 +            pixel = *src;
   1.650 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
   1.651 +            if (flags & SDL_COPY_MODULATE_COLOR) {
   1.652 +                R = (R * modulateR) / 255;
   1.653 +                G = (G * modulateG) / 255;
   1.654 +                B = (B * modulateB) / 255;
   1.655 +            }
   1.656 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.657 +                A = (A * modulateA) / 255;
   1.658 +            }
   1.659 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.660 +            *dst = pixel;
   1.661 +            ++src;
   1.662 +            ++dst;
   1.663 +        }
   1.664 +        info->src += info->src_pitch;
   1.665 +        info->dst += info->dst_pitch;
   1.666 +    }
   1.667 +}
   1.668 +
   1.669 +static void SDL_Blit_BGR888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
   1.670 +{
   1.671 +    const int flags = info->flags;
   1.672 +    const Uint32 modulateR = info->r;
   1.673 +    const Uint32 modulateG = info->g;
   1.674 +    const Uint32 modulateB = info->b;
   1.675 +    const Uint32 modulateA = info->a;
   1.676 +    Uint32 pixel;
   1.677 +    Uint32 R, G, B, A;
   1.678 +    int srcy, srcx;
   1.679 +    int posy, posx;
   1.680 +    int incy, incx;
   1.681 +
   1.682 +    srcy = 0;
   1.683 +    posy = 0;
   1.684 +    incy = (info->src_h << 16) / info->dst_h;
   1.685 +    incx = (info->src_w << 16) / info->dst_w;
   1.686 +
   1.687 +    while (info->dst_h--) {
   1.688 +        Uint32 *src;
   1.689 +        Uint32 *dst = (Uint32 *)info->dst;
   1.690 +        int n = info->dst_w;
   1.691 +        srcx = -1;
   1.692 +        posx = 0x10000L;
   1.693 +        while (posy >= 0x10000L) {
   1.694 +            ++srcy;
   1.695 +            posy -= 0x10000L;
   1.696 +        }
   1.697 +        while (n--) {
   1.698 +            if (posx >= 0x10000L) {
   1.699 +                while (posx >= 0x10000L) {
   1.700 +                    ++srcx;
   1.701 +                    posx -= 0x10000L;
   1.702 +                }
   1.703 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.704 +            }
   1.705 +            pixel = *src;
   1.706 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
   1.707 +            if (flags & SDL_COPY_MODULATE_COLOR) {
   1.708 +                R = (R * modulateR) / 255;
   1.709 +                G = (G * modulateG) / 255;
   1.710 +                B = (B * modulateB) / 255;
   1.711 +            }
   1.712 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.713 +                A = (A * modulateA) / 255;
   1.714 +            }
   1.715 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.716 +            *dst = pixel;
   1.717 +            posx += incx;
   1.718 +            ++dst;
   1.719 +        }
   1.720 +        posy += incy;
   1.721 +        info->dst += info->dst_pitch;
   1.722 +    }
   1.723 +}
   1.724 +
   1.725 +static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
   1.726 +{
   1.727 +    const int flags = info->flags;
   1.728 +    const Uint32 modulateR = info->r;
   1.729 +    const Uint32 modulateG = info->g;
   1.730 +    const Uint32 modulateB = info->b;
   1.731 +    const Uint32 modulateA = info->a;
   1.732 +    Uint32 srcpixel;
   1.733 +    Uint32 srcR, srcG, srcB, srcA;
   1.734 +    Uint32 dstpixel;
   1.735 +    Uint32 dstR, dstG, dstB, dstA;
   1.736 +
   1.737 +    while (info->dst_h--) {
   1.738 +        Uint32 *src = (Uint32 *)info->src;
   1.739 +        Uint32 *dst = (Uint32 *)info->dst;
   1.740 +        int n = info->dst_w;
   1.741 +        while (n--) {
   1.742 +            srcpixel = *src;
   1.743 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
   1.744 +            dstpixel = *dst;
   1.745 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.746 +            if (flags & SDL_COPY_MODULATE_COLOR) {
   1.747 +                srcR = (srcR * modulateR) / 255;
   1.748 +                srcG = (srcG * modulateG) / 255;
   1.749 +                srcB = (srcB * modulateB) / 255;
   1.750 +            }
   1.751 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.752 +                srcA = (srcA * modulateA) / 255;
   1.753 +            }
   1.754 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.755 +                /* This goes away if we ever use premultiplied alpha */
   1.756 +                if (srcA < 255) {
   1.757 +                    srcR = (srcR * srcA) / 255;
   1.758 +                    srcG = (srcG * srcA) / 255;
   1.759 +                    srcB = (srcB * srcA) / 255;
   1.760 +                }
   1.761 +            }
   1.762 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   1.763 +            case SDL_COPY_MASK:
   1.764 +                if (srcA) {
   1.765 +                    dstR = srcR;
   1.766 +                    dstG = srcG;
   1.767 +                    dstB = srcB;
   1.768 +                }
   1.769 +                break;
   1.770 +            case SDL_COPY_BLEND:
   1.771 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
   1.772 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
   1.773 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
   1.774 +                break;
   1.775 +            case SDL_COPY_ADD:
   1.776 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
   1.777 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
   1.778 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
   1.779 +                break;
   1.780 +            case SDL_COPY_MOD:
   1.781 +                dstR = (srcR * dstR) / 255;
   1.782 +                dstG = (srcG * dstG) / 255;
   1.783 +                dstB = (srcB * dstB) / 255;
   1.784 +                break;
   1.785 +            }
   1.786 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.787 +            *dst = dstpixel;
   1.788 +            ++src;
   1.789 +            ++dst;
   1.790 +        }
   1.791 +        info->src += info->src_pitch;
   1.792 +        info->dst += info->dst_pitch;
   1.793 +    }
   1.794 +}
   1.795 +
   1.796 +static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
   1.797 +{
   1.798 +    const int flags = info->flags;
   1.799 +    const Uint32 modulateR = info->r;
   1.800 +    const Uint32 modulateG = info->g;
   1.801 +    const Uint32 modulateB = info->b;
   1.802 +    const Uint32 modulateA = info->a;
   1.803 +    Uint32 srcpixel;
   1.804 +    Uint32 srcR, srcG, srcB, srcA;
   1.805 +    Uint32 dstpixel;
   1.806 +    Uint32 dstR, dstG, dstB, dstA;
   1.807 +    int srcy, srcx;
   1.808 +    int posy, posx;
   1.809 +    int incy, incx;
   1.810 +
   1.811 +    srcy = 0;
   1.812 +    posy = 0;
   1.813 +    incy = (info->src_h << 16) / info->dst_h;
   1.814 +    incx = (info->src_w << 16) / info->dst_w;
   1.815 +
   1.816 +    while (info->dst_h--) {
   1.817 +        Uint32 *src;
   1.818 +        Uint32 *dst = (Uint32 *)info->dst;
   1.819 +        int n = info->dst_w;
   1.820 +        srcx = -1;
   1.821 +        posx = 0x10000L;
   1.822 +        while (posy >= 0x10000L) {
   1.823 +            ++srcy;
   1.824 +            posy -= 0x10000L;
   1.825 +        }
   1.826 +        while (n--) {
   1.827 +            if (posx >= 0x10000L) {
   1.828 +                while (posx >= 0x10000L) {
   1.829 +                    ++srcx;
   1.830 +                    posx -= 0x10000L;
   1.831 +                }
   1.832 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.833 +            }
   1.834 +            srcpixel = *src;
   1.835 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
   1.836 +            dstpixel = *dst;
   1.837 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.838 +            if (flags & SDL_COPY_MODULATE_COLOR) {
   1.839 +                srcR = (srcR * modulateR) / 255;
   1.840 +                srcG = (srcG * modulateG) / 255;
   1.841 +                srcB = (srcB * modulateB) / 255;
   1.842 +            }
   1.843 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.844 +                srcA = (srcA * modulateA) / 255;
   1.845 +            }
   1.846 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.847 +                /* This goes away if we ever use premultiplied alpha */
   1.848 +                if (srcA < 255) {
   1.849 +                    srcR = (srcR * srcA) / 255;
   1.850 +                    srcG = (srcG * srcA) / 255;
   1.851 +                    srcB = (srcB * srcA) / 255;
   1.852 +                }
   1.853 +            }
   1.854 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   1.855 +            case SDL_COPY_MASK:
   1.856 +                if (srcA) {
   1.857 +                    dstR = srcR;
   1.858 +                    dstG = srcG;
   1.859 +                    dstB = srcB;
   1.860 +                }
   1.861 +                break;
   1.862 +            case SDL_COPY_BLEND:
   1.863 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
   1.864 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
   1.865 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
   1.866 +                break;
   1.867 +            case SDL_COPY_ADD:
   1.868 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
   1.869 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
   1.870 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
   1.871 +                break;
   1.872 +            case SDL_COPY_MOD:
   1.873 +                dstR = (srcR * dstR) / 255;
   1.874 +                dstG = (srcG * dstG) / 255;
   1.875 +                dstB = (srcB * dstB) / 255;
   1.876 +                break;
   1.877 +            }
   1.878 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.879 +            *dst = dstpixel;
   1.880 +            posx += incx;
   1.881 +            ++dst;
   1.882 +        }
   1.883 +        posy += incy;
   1.884 +        info->dst += info->dst_pitch;
   1.885 +    }
   1.886 +}
   1.887 +
   1.888  static void SDL_Blit_ARGB8888_RGB888_Scale(SDL_BlitInfo *info)
   1.889  {
   1.890      const int flags = info->flags;
   1.891 @@ -2640,6 +3514,438 @@
   1.892      }
   1.893  }
   1.894  
   1.895 +static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info)
   1.896 +{
   1.897 +    const int flags = info->flags;
   1.898 +    int srcy, srcx;
   1.899 +    int posy, posx;
   1.900 +    int incy, incx;
   1.901 +
   1.902 +    srcy = 0;
   1.903 +    posy = 0;
   1.904 +    incy = (info->src_h << 16) / info->dst_h;
   1.905 +    incx = (info->src_w << 16) / info->dst_w;
   1.906 +
   1.907 +    while (info->dst_h--) {
   1.908 +        Uint32 *src;
   1.909 +        Uint32 *dst = (Uint32 *)info->dst;
   1.910 +        int n = info->dst_w;
   1.911 +        srcx = -1;
   1.912 +        posx = 0x10000L;
   1.913 +        while (posy >= 0x10000L) {
   1.914 +            ++srcy;
   1.915 +            posy -= 0x10000L;
   1.916 +        }
   1.917 +        while (n--) {
   1.918 +            if (posx >= 0x10000L) {
   1.919 +                while (posx >= 0x10000L) {
   1.920 +                    ++srcx;
   1.921 +                    posx -= 0x10000L;
   1.922 +                }
   1.923 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.924 +            }
   1.925 +            *dst = *src;
   1.926 +            posx += incx;
   1.927 +            ++dst;
   1.928 +        }
   1.929 +        posy += incy;
   1.930 +        info->dst += info->dst_pitch;
   1.931 +    }
   1.932 +}
   1.933 +
   1.934 +static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info)
   1.935 +{
   1.936 +    const int flags = info->flags;
   1.937 +    Uint32 srcpixel;
   1.938 +    Uint32 srcR, srcG, srcB, srcA;
   1.939 +    Uint32 dstpixel;
   1.940 +    Uint32 dstR, dstG, dstB, dstA;
   1.941 +
   1.942 +    while (info->dst_h--) {
   1.943 +        Uint32 *src = (Uint32 *)info->src;
   1.944 +        Uint32 *dst = (Uint32 *)info->dst;
   1.945 +        int n = info->dst_w;
   1.946 +        while (n--) {
   1.947 +            srcpixel = *src;
   1.948 +            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.949 +            dstpixel = *dst;
   1.950 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.951 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.952 +                /* This goes away if we ever use premultiplied alpha */
   1.953 +                if (srcA < 255) {
   1.954 +                    srcR = (srcR * srcA) / 255;
   1.955 +                    srcG = (srcG * srcA) / 255;
   1.956 +                    srcB = (srcB * srcA) / 255;
   1.957 +                }
   1.958 +            }
   1.959 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   1.960 +            case SDL_COPY_MASK:
   1.961 +                if (srcA) {
   1.962 +                    dstR = srcR;
   1.963 +                    dstG = srcG;
   1.964 +                    dstB = srcB;
   1.965 +                }
   1.966 +                break;
   1.967 +            case SDL_COPY_BLEND:
   1.968 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
   1.969 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
   1.970 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
   1.971 +                break;
   1.972 +            case SDL_COPY_ADD:
   1.973 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
   1.974 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
   1.975 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
   1.976 +                break;
   1.977 +            case SDL_COPY_MOD:
   1.978 +                dstR = (srcR * dstR) / 255;
   1.979 +                dstG = (srcG * dstG) / 255;
   1.980 +                dstB = (srcB * dstB) / 255;
   1.981 +                break;
   1.982 +            }
   1.983 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
   1.984 +            *dst = dstpixel;
   1.985 +            ++src;
   1.986 +            ++dst;
   1.987 +        }
   1.988 +        info->src += info->src_pitch;
   1.989 +        info->dst += info->dst_pitch;
   1.990 +    }
   1.991 +}
   1.992 +
   1.993 +static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
   1.994 +{
   1.995 +    const int flags = info->flags;
   1.996 +    Uint32 srcpixel;
   1.997 +    Uint32 srcR, srcG, srcB, srcA;
   1.998 +    Uint32 dstpixel;
   1.999 +    Uint32 dstR, dstG, dstB, dstA;
  1.1000 +    int srcy, srcx;
  1.1001 +    int posy, posx;
  1.1002 +    int incy, incx;
  1.1003 +
  1.1004 +    srcy = 0;
  1.1005 +    posy = 0;
  1.1006 +    incy = (info->src_h << 16) / info->dst_h;
  1.1007 +    incx = (info->src_w << 16) / info->dst_w;
  1.1008 +
  1.1009 +    while (info->dst_h--) {
  1.1010 +        Uint32 *src;
  1.1011 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1012 +        int n = info->dst_w;
  1.1013 +        srcx = -1;
  1.1014 +        posx = 0x10000L;
  1.1015 +        while (posy >= 0x10000L) {
  1.1016 +            ++srcy;
  1.1017 +            posy -= 0x10000L;
  1.1018 +        }
  1.1019 +        while (n--) {
  1.1020 +            if (posx >= 0x10000L) {
  1.1021 +                while (posx >= 0x10000L) {
  1.1022 +                    ++srcx;
  1.1023 +                    posx -= 0x10000L;
  1.1024 +                }
  1.1025 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1026 +            }
  1.1027 +            srcpixel = *src;
  1.1028 +            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
  1.1029 +            dstpixel = *dst;
  1.1030 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1031 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1032 +                /* This goes away if we ever use premultiplied alpha */
  1.1033 +                if (srcA < 255) {
  1.1034 +                    srcR = (srcR * srcA) / 255;
  1.1035 +                    srcG = (srcG * srcA) / 255;
  1.1036 +                    srcB = (srcB * srcA) / 255;
  1.1037 +                }
  1.1038 +            }
  1.1039 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1040 +            case SDL_COPY_MASK:
  1.1041 +                if (srcA) {
  1.1042 +                    dstR = srcR;
  1.1043 +                    dstG = srcG;
  1.1044 +                    dstB = srcB;
  1.1045 +                }
  1.1046 +                break;
  1.1047 +            case SDL_COPY_BLEND:
  1.1048 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1049 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1050 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1051 +                break;
  1.1052 +            case SDL_COPY_ADD:
  1.1053 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1054 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1055 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1056 +                break;
  1.1057 +            case SDL_COPY_MOD:
  1.1058 +                dstR = (srcR * dstR) / 255;
  1.1059 +                dstG = (srcG * dstG) / 255;
  1.1060 +                dstB = (srcB * dstB) / 255;
  1.1061 +                break;
  1.1062 +            }
  1.1063 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1064 +            *dst = dstpixel;
  1.1065 +            posx += incx;
  1.1066 +            ++dst;
  1.1067 +        }
  1.1068 +        posy += incy;
  1.1069 +        info->dst += info->dst_pitch;
  1.1070 +    }
  1.1071 +}
  1.1072 +
  1.1073 +static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info)
  1.1074 +{
  1.1075 +    const int flags = info->flags;
  1.1076 +    const Uint32 modulateR = info->r;
  1.1077 +    const Uint32 modulateG = info->g;
  1.1078 +    const Uint32 modulateB = info->b;
  1.1079 +    const Uint32 modulateA = info->a;
  1.1080 +    Uint32 pixel;
  1.1081 +    Uint32 R, G, B, A;
  1.1082 +
  1.1083 +    while (info->dst_h--) {
  1.1084 +        Uint32 *src = (Uint32 *)info->src;
  1.1085 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1086 +        int n = info->dst_w;
  1.1087 +        while (n--) {
  1.1088 +            pixel = *src;
  1.1089 +            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
  1.1090 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1091 +                R = (R * modulateR) / 255;
  1.1092 +                G = (G * modulateG) / 255;
  1.1093 +                B = (B * modulateB) / 255;
  1.1094 +            }
  1.1095 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1096 +                A = (A * modulateA) / 255;
  1.1097 +            }
  1.1098 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1099 +            *dst = pixel;
  1.1100 +            ++src;
  1.1101 +            ++dst;
  1.1102 +        }
  1.1103 +        info->src += info->src_pitch;
  1.1104 +        info->dst += info->dst_pitch;
  1.1105 +    }
  1.1106 +}
  1.1107 +
  1.1108 +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
  1.1109 +{
  1.1110 +    const int flags = info->flags;
  1.1111 +    const Uint32 modulateR = info->r;
  1.1112 +    const Uint32 modulateG = info->g;
  1.1113 +    const Uint32 modulateB = info->b;
  1.1114 +    const Uint32 modulateA = info->a;
  1.1115 +    Uint32 pixel;
  1.1116 +    Uint32 R, G, B, A;
  1.1117 +    int srcy, srcx;
  1.1118 +    int posy, posx;
  1.1119 +    int incy, incx;
  1.1120 +
  1.1121 +    srcy = 0;
  1.1122 +    posy = 0;
  1.1123 +    incy = (info->src_h << 16) / info->dst_h;
  1.1124 +    incx = (info->src_w << 16) / info->dst_w;
  1.1125 +
  1.1126 +    while (info->dst_h--) {
  1.1127 +        Uint32 *src;
  1.1128 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1129 +        int n = info->dst_w;
  1.1130 +        srcx = -1;
  1.1131 +        posx = 0x10000L;
  1.1132 +        while (posy >= 0x10000L) {
  1.1133 +            ++srcy;
  1.1134 +            posy -= 0x10000L;
  1.1135 +        }
  1.1136 +        while (n--) {
  1.1137 +            if (posx >= 0x10000L) {
  1.1138 +                while (posx >= 0x10000L) {
  1.1139 +                    ++srcx;
  1.1140 +                    posx -= 0x10000L;
  1.1141 +                }
  1.1142 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1143 +            }
  1.1144 +            pixel = *src;
  1.1145 +            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
  1.1146 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1147 +                R = (R * modulateR) / 255;
  1.1148 +                G = (G * modulateG) / 255;
  1.1149 +                B = (B * modulateB) / 255;
  1.1150 +            }
  1.1151 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1152 +                A = (A * modulateA) / 255;
  1.1153 +            }
  1.1154 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1155 +            *dst = pixel;
  1.1156 +            posx += incx;
  1.1157 +            ++dst;
  1.1158 +        }
  1.1159 +        posy += incy;
  1.1160 +        info->dst += info->dst_pitch;
  1.1161 +    }
  1.1162 +}
  1.1163 +
  1.1164 +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
  1.1165 +{
  1.1166 +    const int flags = info->flags;
  1.1167 +    const Uint32 modulateR = info->r;
  1.1168 +    const Uint32 modulateG = info->g;
  1.1169 +    const Uint32 modulateB = info->b;
  1.1170 +    const Uint32 modulateA = info->a;
  1.1171 +    Uint32 srcpixel;
  1.1172 +    Uint32 srcR, srcG, srcB, srcA;
  1.1173 +    Uint32 dstpixel;
  1.1174 +    Uint32 dstR, dstG, dstB, dstA;
  1.1175 +
  1.1176 +    while (info->dst_h--) {
  1.1177 +        Uint32 *src = (Uint32 *)info->src;
  1.1178 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1179 +        int n = info->dst_w;
  1.1180 +        while (n--) {
  1.1181 +            srcpixel = *src;
  1.1182 +            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
  1.1183 +            dstpixel = *dst;
  1.1184 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1185 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1186 +                srcR = (srcR * modulateR) / 255;
  1.1187 +                srcG = (srcG * modulateG) / 255;
  1.1188 +                srcB = (srcB * modulateB) / 255;
  1.1189 +            }
  1.1190 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1191 +                srcA = (srcA * modulateA) / 255;
  1.1192 +            }
  1.1193 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1194 +                /* This goes away if we ever use premultiplied alpha */
  1.1195 +                if (srcA < 255) {
  1.1196 +                    srcR = (srcR * srcA) / 255;
  1.1197 +                    srcG = (srcG * srcA) / 255;
  1.1198 +                    srcB = (srcB * srcA) / 255;
  1.1199 +                }
  1.1200 +            }
  1.1201 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1202 +            case SDL_COPY_MASK:
  1.1203 +                if (srcA) {
  1.1204 +                    dstR = srcR;
  1.1205 +                    dstG = srcG;
  1.1206 +                    dstB = srcB;
  1.1207 +                }
  1.1208 +                break;
  1.1209 +            case SDL_COPY_BLEND:
  1.1210 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1211 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1212 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1213 +                break;
  1.1214 +            case SDL_COPY_ADD:
  1.1215 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1216 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1217 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1218 +                break;
  1.1219 +            case SDL_COPY_MOD:
  1.1220 +                dstR = (srcR * dstR) / 255;
  1.1221 +                dstG = (srcG * dstG) / 255;
  1.1222 +                dstB = (srcB * dstB) / 255;
  1.1223 +                break;
  1.1224 +            }
  1.1225 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1226 +            *dst = dstpixel;
  1.1227 +            ++src;
  1.1228 +            ++dst;
  1.1229 +        }
  1.1230 +        info->src += info->src_pitch;
  1.1231 +        info->dst += info->dst_pitch;
  1.1232 +    }
  1.1233 +}
  1.1234 +
  1.1235 +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
  1.1236 +{
  1.1237 +    const int flags = info->flags;
  1.1238 +    const Uint32 modulateR = info->r;
  1.1239 +    const Uint32 modulateG = info->g;
  1.1240 +    const Uint32 modulateB = info->b;
  1.1241 +    const Uint32 modulateA = info->a;
  1.1242 +    Uint32 srcpixel;
  1.1243 +    Uint32 srcR, srcG, srcB, srcA;
  1.1244 +    Uint32 dstpixel;
  1.1245 +    Uint32 dstR, dstG, dstB, dstA;
  1.1246 +    int srcy, srcx;
  1.1247 +    int posy, posx;
  1.1248 +    int incy, incx;
  1.1249 +
  1.1250 +    srcy = 0;
  1.1251 +    posy = 0;
  1.1252 +    incy = (info->src_h << 16) / info->dst_h;
  1.1253 +    incx = (info->src_w << 16) / info->dst_w;
  1.1254 +
  1.1255 +    while (info->dst_h--) {
  1.1256 +        Uint32 *src;
  1.1257 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1258 +        int n = info->dst_w;
  1.1259 +        srcx = -1;
  1.1260 +        posx = 0x10000L;
  1.1261 +        while (posy >= 0x10000L) {
  1.1262 +            ++srcy;
  1.1263 +            posy -= 0x10000L;
  1.1264 +        }
  1.1265 +        while (n--) {
  1.1266 +            if (posx >= 0x10000L) {
  1.1267 +                while (posx >= 0x10000L) {
  1.1268 +                    ++srcx;
  1.1269 +                    posx -= 0x10000L;
  1.1270 +                }
  1.1271 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1272 +            }
  1.1273 +            srcpixel = *src;
  1.1274 +            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
  1.1275 +            dstpixel = *dst;
  1.1276 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1277 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1278 +                srcR = (srcR * modulateR) / 255;
  1.1279 +                srcG = (srcG * modulateG) / 255;
  1.1280 +                srcB = (srcB * modulateB) / 255;
  1.1281 +            }
  1.1282 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1283 +                srcA = (srcA * modulateA) / 255;
  1.1284 +            }
  1.1285 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1286 +                /* This goes away if we ever use premultiplied alpha */
  1.1287 +                if (srcA < 255) {
  1.1288 +                    srcR = (srcR * srcA) / 255;
  1.1289 +                    srcG = (srcG * srcA) / 255;
  1.1290 +                    srcB = (srcB * srcA) / 255;
  1.1291 +                }
  1.1292 +            }
  1.1293 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1294 +            case SDL_COPY_MASK:
  1.1295 +                if (srcA) {
  1.1296 +                    dstR = srcR;
  1.1297 +                    dstG = srcG;
  1.1298 +                    dstB = srcB;
  1.1299 +                }
  1.1300 +                break;
  1.1301 +            case SDL_COPY_BLEND:
  1.1302 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1303 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1304 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1305 +                break;
  1.1306 +            case SDL_COPY_ADD:
  1.1307 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1308 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1309 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1310 +                break;
  1.1311 +            case SDL_COPY_MOD:
  1.1312 +                dstR = (srcR * dstR) / 255;
  1.1313 +                dstG = (srcG * dstG) / 255;
  1.1314 +                dstB = (srcB * dstB) / 255;
  1.1315 +                break;
  1.1316 +            }
  1.1317 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1318 +            *dst = dstpixel;
  1.1319 +            posx += incx;
  1.1320 +            ++dst;
  1.1321 +        }
  1.1322 +        posy += incy;
  1.1323 +        info->dst += info->dst_pitch;
  1.1324 +    }
  1.1325 +}
  1.1326 +
  1.1327  static void SDL_Blit_RGBA8888_RGB888_Scale(SDL_BlitInfo *info)
  1.1328  {
  1.1329      const int flags = info->flags;
  1.1330 @@ -3514,6 +4820,443 @@
  1.1331      }
  1.1332  }
  1.1333  
  1.1334 +static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info)
  1.1335 +{
  1.1336 +    const int flags = info->flags;
  1.1337 +    Uint32 pixel;
  1.1338 +    Uint32 R, G, B, A;
  1.1339 +    int srcy, srcx;
  1.1340 +    int posy, posx;
  1.1341 +    int incy, incx;
  1.1342 +
  1.1343 +    srcy = 0;
  1.1344 +    posy = 0;
  1.1345 +    incy = (info->src_h << 16) / info->dst_h;
  1.1346 +    incx = (info->src_w << 16) / info->dst_w;
  1.1347 +
  1.1348 +    while (info->dst_h--) {
  1.1349 +        Uint32 *src;
  1.1350 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1351 +        int n = info->dst_w;
  1.1352 +        srcx = -1;
  1.1353 +        posx = 0x10000L;
  1.1354 +        while (posy >= 0x10000L) {
  1.1355 +            ++srcy;
  1.1356 +            posy -= 0x10000L;
  1.1357 +        }
  1.1358 +        while (n--) {
  1.1359 +            if (posx >= 0x10000L) {
  1.1360 +                while (posx >= 0x10000L) {
  1.1361 +                    ++srcx;
  1.1362 +                    posx -= 0x10000L;
  1.1363 +                }
  1.1364 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1365 +            }
  1.1366 +            pixel = *src;
  1.1367 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1368 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1369 +            *dst = pixel;
  1.1370 +            posx += incx;
  1.1371 +            ++dst;
  1.1372 +        }
  1.1373 +        posy += incy;
  1.1374 +        info->dst += info->dst_pitch;
  1.1375 +    }
  1.1376 +}
  1.1377 +
  1.1378 +static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info)
  1.1379 +{
  1.1380 +    const int flags = info->flags;
  1.1381 +    Uint32 srcpixel;
  1.1382 +    Uint32 srcR, srcG, srcB, srcA;
  1.1383 +    Uint32 dstpixel;
  1.1384 +    Uint32 dstR, dstG, dstB, dstA;
  1.1385 +
  1.1386 +    while (info->dst_h--) {
  1.1387 +        Uint32 *src = (Uint32 *)info->src;
  1.1388 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1389 +        int n = info->dst_w;
  1.1390 +        while (n--) {
  1.1391 +            srcpixel = *src;
  1.1392 +            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1393 +            dstpixel = *dst;
  1.1394 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1395 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1396 +                /* This goes away if we ever use premultiplied alpha */
  1.1397 +                if (srcA < 255) {
  1.1398 +                    srcR = (srcR * srcA) / 255;
  1.1399 +                    srcG = (srcG * srcA) / 255;
  1.1400 +                    srcB = (srcB * srcA) / 255;
  1.1401 +                }
  1.1402 +            }
  1.1403 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1404 +            case SDL_COPY_MASK:
  1.1405 +                if (srcA) {
  1.1406 +                    dstR = srcR;
  1.1407 +                    dstG = srcG;
  1.1408 +                    dstB = srcB;
  1.1409 +                }
  1.1410 +                break;
  1.1411 +            case SDL_COPY_BLEND:
  1.1412 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1413 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1414 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1415 +                break;
  1.1416 +            case SDL_COPY_ADD:
  1.1417 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1418 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1419 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1420 +                break;
  1.1421 +            case SDL_COPY_MOD:
  1.1422 +                dstR = (srcR * dstR) / 255;
  1.1423 +                dstG = (srcG * dstG) / 255;
  1.1424 +                dstB = (srcB * dstB) / 255;
  1.1425 +                break;
  1.1426 +            }
  1.1427 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1428 +            *dst = dstpixel;
  1.1429 +            ++src;
  1.1430 +            ++dst;
  1.1431 +        }
  1.1432 +        info->src += info->src_pitch;
  1.1433 +        info->dst += info->dst_pitch;
  1.1434 +    }
  1.1435 +}
  1.1436 +
  1.1437 +static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
  1.1438 +{
  1.1439 +    const int flags = info->flags;
  1.1440 +    Uint32 srcpixel;
  1.1441 +    Uint32 srcR, srcG, srcB, srcA;
  1.1442 +    Uint32 dstpixel;
  1.1443 +    Uint32 dstR, dstG, dstB, dstA;
  1.1444 +    int srcy, srcx;
  1.1445 +    int posy, posx;
  1.1446 +    int incy, incx;
  1.1447 +
  1.1448 +    srcy = 0;
  1.1449 +    posy = 0;
  1.1450 +    incy = (info->src_h << 16) / info->dst_h;
  1.1451 +    incx = (info->src_w << 16) / info->dst_w;
  1.1452 +
  1.1453 +    while (info->dst_h--) {
  1.1454 +        Uint32 *src;
  1.1455 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1456 +        int n = info->dst_w;
  1.1457 +        srcx = -1;
  1.1458 +        posx = 0x10000L;
  1.1459 +        while (posy >= 0x10000L) {
  1.1460 +            ++srcy;
  1.1461 +            posy -= 0x10000L;
  1.1462 +        }
  1.1463 +        while (n--) {
  1.1464 +            if (posx >= 0x10000L) {
  1.1465 +                while (posx >= 0x10000L) {
  1.1466 +                    ++srcx;
  1.1467 +                    posx -= 0x10000L;
  1.1468 +                }
  1.1469 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1470 +            }
  1.1471 +            srcpixel = *src;
  1.1472 +            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1473 +            dstpixel = *dst;
  1.1474 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1475 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1476 +                /* This goes away if we ever use premultiplied alpha */
  1.1477 +                if (srcA < 255) {
  1.1478 +                    srcR = (srcR * srcA) / 255;
  1.1479 +                    srcG = (srcG * srcA) / 255;
  1.1480 +                    srcB = (srcB * srcA) / 255;
  1.1481 +                }
  1.1482 +            }
  1.1483 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1484 +            case SDL_COPY_MASK:
  1.1485 +                if (srcA) {
  1.1486 +                    dstR = srcR;
  1.1487 +                    dstG = srcG;
  1.1488 +                    dstB = srcB;
  1.1489 +                }
  1.1490 +                break;
  1.1491 +            case SDL_COPY_BLEND:
  1.1492 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1493 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1494 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1495 +                break;
  1.1496 +            case SDL_COPY_ADD:
  1.1497 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1498 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1499 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1500 +                break;
  1.1501 +            case SDL_COPY_MOD:
  1.1502 +                dstR = (srcR * dstR) / 255;
  1.1503 +                dstG = (srcG * dstG) / 255;
  1.1504 +                dstB = (srcB * dstB) / 255;
  1.1505 +                break;
  1.1506 +            }
  1.1507 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1508 +            *dst = dstpixel;
  1.1509 +            posx += incx;
  1.1510 +            ++dst;
  1.1511 +        }
  1.1512 +        posy += incy;
  1.1513 +        info->dst += info->dst_pitch;
  1.1514 +    }
  1.1515 +}
  1.1516 +
  1.1517 +static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
  1.1518 +{
  1.1519 +    const int flags = info->flags;
  1.1520 +    const Uint32 modulateR = info->r;
  1.1521 +    const Uint32 modulateG = info->g;
  1.1522 +    const Uint32 modulateB = info->b;
  1.1523 +    const Uint32 modulateA = info->a;
  1.1524 +    Uint32 pixel;
  1.1525 +    Uint32 R, G, B, A;
  1.1526 +
  1.1527 +    while (info->dst_h--) {
  1.1528 +        Uint32 *src = (Uint32 *)info->src;
  1.1529 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1530 +        int n = info->dst_w;
  1.1531 +        while (n--) {
  1.1532 +            pixel = *src;
  1.1533 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1534 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1535 +                R = (R * modulateR) / 255;
  1.1536 +                G = (G * modulateG) / 255;
  1.1537 +                B = (B * modulateB) / 255;
  1.1538 +            }
  1.1539 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1540 +                A = (A * modulateA) / 255;
  1.1541 +            }
  1.1542 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1543 +            *dst = pixel;
  1.1544 +            ++src;
  1.1545 +            ++dst;
  1.1546 +        }
  1.1547 +        info->src += info->src_pitch;
  1.1548 +        info->dst += info->dst_pitch;
  1.1549 +    }
  1.1550 +}
  1.1551 +
  1.1552 +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
  1.1553 +{
  1.1554 +    const int flags = info->flags;
  1.1555 +    const Uint32 modulateR = info->r;
  1.1556 +    const Uint32 modulateG = info->g;
  1.1557 +    const Uint32 modulateB = info->b;
  1.1558 +    const Uint32 modulateA = info->a;
  1.1559 +    Uint32 pixel;
  1.1560 +    Uint32 R, G, B, A;
  1.1561 +    int srcy, srcx;
  1.1562 +    int posy, posx;
  1.1563 +    int incy, incx;
  1.1564 +
  1.1565 +    srcy = 0;
  1.1566 +    posy = 0;
  1.1567 +    incy = (info->src_h << 16) / info->dst_h;
  1.1568 +    incx = (info->src_w << 16) / info->dst_w;
  1.1569 +
  1.1570 +    while (info->dst_h--) {
  1.1571 +        Uint32 *src;
  1.1572 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1573 +        int n = info->dst_w;
  1.1574 +        srcx = -1;
  1.1575 +        posx = 0x10000L;
  1.1576 +        while (posy >= 0x10000L) {
  1.1577 +            ++srcy;
  1.1578 +            posy -= 0x10000L;
  1.1579 +        }
  1.1580 +        while (n--) {
  1.1581 +            if (posx >= 0x10000L) {
  1.1582 +                while (posx >= 0x10000L) {
  1.1583 +                    ++srcx;
  1.1584 +                    posx -= 0x10000L;
  1.1585 +                }
  1.1586 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1587 +            }
  1.1588 +            pixel = *src;
  1.1589 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1590 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1591 +                R = (R * modulateR) / 255;
  1.1592 +                G = (G * modulateG) / 255;
  1.1593 +                B = (B * modulateB) / 255;
  1.1594 +            }
  1.1595 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1596 +                A = (A * modulateA) / 255;
  1.1597 +            }
  1.1598 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1599 +            *dst = pixel;
  1.1600 +            posx += incx;
  1.1601 +            ++dst;
  1.1602 +        }
  1.1603 +        posy += incy;
  1.1604 +        info->dst += info->dst_pitch;
  1.1605 +    }
  1.1606 +}
  1.1607 +
  1.1608 +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
  1.1609 +{
  1.1610 +    const int flags = info->flags;
  1.1611 +    const Uint32 modulateR = info->r;
  1.1612 +    const Uint32 modulateG = info->g;
  1.1613 +    const Uint32 modulateB = info->b;
  1.1614 +    const Uint32 modulateA = info->a;
  1.1615 +    Uint32 srcpixel;
  1.1616 +    Uint32 srcR, srcG, srcB, srcA;
  1.1617 +    Uint32 dstpixel;
  1.1618 +    Uint32 dstR, dstG, dstB, dstA;
  1.1619 +
  1.1620 +    while (info->dst_h--) {
  1.1621 +        Uint32 *src = (Uint32 *)info->src;
  1.1622 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1623 +        int n = info->dst_w;
  1.1624 +        while (n--) {
  1.1625 +            srcpixel = *src;
  1.1626 +            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1627 +            dstpixel = *dst;
  1.1628 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1629 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1630 +                srcR = (srcR * modulateR) / 255;
  1.1631 +                srcG = (srcG * modulateG) / 255;
  1.1632 +                srcB = (srcB * modulateB) / 255;
  1.1633 +            }
  1.1634 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1635 +                srcA = (srcA * modulateA) / 255;
  1.1636 +            }
  1.1637 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1638 +                /* This goes away if we ever use premultiplied alpha */
  1.1639 +                if (srcA < 255) {
  1.1640 +                    srcR = (srcR * srcA) / 255;
  1.1641 +                    srcG = (srcG * srcA) / 255;
  1.1642 +                    srcB = (srcB * srcA) / 255;
  1.1643 +                }
  1.1644 +            }
  1.1645 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1646 +            case SDL_COPY_MASK:
  1.1647 +                if (srcA) {
  1.1648 +                    dstR = srcR;
  1.1649 +                    dstG = srcG;
  1.1650 +                    dstB = srcB;
  1.1651 +                }
  1.1652 +                break;
  1.1653 +            case SDL_COPY_BLEND:
  1.1654 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1655 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1656 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1657 +                break;
  1.1658 +            case SDL_COPY_ADD:
  1.1659 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1660 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1661 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1662 +                break;
  1.1663 +            case SDL_COPY_MOD:
  1.1664 +                dstR = (srcR * dstR) / 255;
  1.1665 +                dstG = (srcG * dstG) / 255;
  1.1666 +                dstB = (srcB * dstB) / 255;
  1.1667 +                break;
  1.1668 +            }
  1.1669 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1670 +            *dst = dstpixel;
  1.1671 +            ++src;
  1.1672 +            ++dst;
  1.1673 +        }
  1.1674 +        info->src += info->src_pitch;
  1.1675 +        info->dst += info->dst_pitch;
  1.1676 +    }
  1.1677 +}
  1.1678 +
  1.1679 +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
  1.1680 +{
  1.1681 +    const int flags = info->flags;
  1.1682 +    const Uint32 modulateR = info->r;
  1.1683 +    const Uint32 modulateG = info->g;
  1.1684 +    const Uint32 modulateB = info->b;
  1.1685 +    const Uint32 modulateA = info->a;
  1.1686 +    Uint32 srcpixel;
  1.1687 +    Uint32 srcR, srcG, srcB, srcA;
  1.1688 +    Uint32 dstpixel;
  1.1689 +    Uint32 dstR, dstG, dstB, dstA;
  1.1690 +    int srcy, srcx;
  1.1691 +    int posy, posx;
  1.1692 +    int incy, incx;
  1.1693 +
  1.1694 +    srcy = 0;
  1.1695 +    posy = 0;
  1.1696 +    incy = (info->src_h << 16) / info->dst_h;
  1.1697 +    incx = (info->src_w << 16) / info->dst_w;
  1.1698 +
  1.1699 +    while (info->dst_h--) {
  1.1700 +        Uint32 *src;
  1.1701 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1702 +        int n = info->dst_w;
  1.1703 +        srcx = -1;
  1.1704 +        posx = 0x10000L;
  1.1705 +        while (posy >= 0x10000L) {
  1.1706 +            ++srcy;
  1.1707 +            posy -= 0x10000L;
  1.1708 +        }
  1.1709 +        while (n--) {
  1.1710 +            if (posx >= 0x10000L) {
  1.1711 +                while (posx >= 0x10000L) {
  1.1712 +                    ++srcx;
  1.1713 +                    posx -= 0x10000L;
  1.1714 +                }
  1.1715 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1716 +            }
  1.1717 +            srcpixel = *src;
  1.1718 +            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1719 +            dstpixel = *dst;
  1.1720 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1721 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1722 +                srcR = (srcR * modulateR) / 255;
  1.1723 +                srcG = (srcG * modulateG) / 255;
  1.1724 +                srcB = (srcB * modulateB) / 255;
  1.1725 +            }
  1.1726 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1727 +                srcA = (srcA * modulateA) / 255;
  1.1728 +            }
  1.1729 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1730 +                /* This goes away if we ever use premultiplied alpha */
  1.1731 +                if (srcA < 255) {
  1.1732 +                    srcR = (srcR * srcA) / 255;
  1.1733 +                    srcG = (srcG * srcA) / 255;
  1.1734 +                    srcB = (srcB * srcA) / 255;
  1.1735 +                }
  1.1736 +            }
  1.1737 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1738 +            case SDL_COPY_MASK:
  1.1739 +                if (srcA) {
  1.1740 +                    dstR = srcR;
  1.1741 +                    dstG = srcG;
  1.1742 +                    dstB = srcB;
  1.1743 +                }
  1.1744 +                break;
  1.1745 +            case SDL_COPY_BLEND:
  1.1746 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1747 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1748 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1749 +                break;
  1.1750 +            case SDL_COPY_ADD:
  1.1751 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1752 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1753 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1754 +                break;
  1.1755 +            case SDL_COPY_MOD:
  1.1756 +                dstR = (srcR * dstR) / 255;
  1.1757 +                dstG = (srcG * dstG) / 255;
  1.1758 +                dstB = (srcB * dstB) / 255;
  1.1759 +                break;
  1.1760 +            }
  1.1761 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1762 +            *dst = dstpixel;
  1.1763 +            posx += incx;
  1.1764 +            ++dst;
  1.1765 +        }
  1.1766 +        posy += incy;
  1.1767 +        info->dst += info->dst_pitch;
  1.1768 +    }
  1.1769 +}
  1.1770 +
  1.1771  static void SDL_Blit_ABGR8888_RGB888_Scale(SDL_BlitInfo *info)
  1.1772  {
  1.1773      const int flags = info->flags;
  1.1774 @@ -4388,6 +6131,443 @@
  1.1775      }
  1.1776  }
  1.1777  
  1.1778 +static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info)
  1.1779 +{
  1.1780 +    const int flags = info->flags;
  1.1781 +    Uint32 pixel;
  1.1782 +    Uint32 R, G, B, A;
  1.1783 +    int srcy, srcx;
  1.1784 +    int posy, posx;
  1.1785 +    int incy, incx;
  1.1786 +
  1.1787 +    srcy = 0;
  1.1788 +    posy = 0;
  1.1789 +    incy = (info->src_h << 16) / info->dst_h;
  1.1790 +    incx = (info->src_w << 16) / info->dst_w;
  1.1791 +
  1.1792 +    while (info->dst_h--) {
  1.1793 +        Uint32 *src;
  1.1794 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1795 +        int n = info->dst_w;
  1.1796 +        srcx = -1;
  1.1797 +        posx = 0x10000L;
  1.1798 +        while (posy >= 0x10000L) {
  1.1799 +            ++srcy;
  1.1800 +            posy -= 0x10000L;
  1.1801 +        }
  1.1802 +        while (n--) {
  1.1803 +            if (posx >= 0x10000L) {
  1.1804 +                while (posx >= 0x10000L) {
  1.1805 +                    ++srcx;
  1.1806 +                    posx -= 0x10000L;
  1.1807 +                }
  1.1808 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1809 +            }
  1.1810 +            pixel = *src;
  1.1811 +            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1812 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1813 +            *dst = pixel;
  1.1814 +            posx += incx;
  1.1815 +            ++dst;
  1.1816 +        }
  1.1817 +        posy += incy;
  1.1818 +        info->dst += info->dst_pitch;
  1.1819 +    }
  1.1820 +}
  1.1821 +
  1.1822 +static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info)
  1.1823 +{
  1.1824 +    const int flags = info->flags;
  1.1825 +    Uint32 srcpixel;
  1.1826 +    Uint32 srcR, srcG, srcB, srcA;
  1.1827 +    Uint32 dstpixel;
  1.1828 +    Uint32 dstR, dstG, dstB, dstA;
  1.1829 +
  1.1830 +    while (info->dst_h--) {
  1.1831 +        Uint32 *src = (Uint32 *)info->src;
  1.1832 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1833 +        int n = info->dst_w;
  1.1834 +        while (n--) {
  1.1835 +            srcpixel = *src;
  1.1836 +            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1837 +            dstpixel = *dst;
  1.1838 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1839 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1840 +                /* This goes away if we ever use premultiplied alpha */
  1.1841 +                if (srcA < 255) {
  1.1842 +                    srcR = (srcR * srcA) / 255;
  1.1843 +                    srcG = (srcG * srcA) / 255;
  1.1844 +                    srcB = (srcB * srcA) / 255;
  1.1845 +                }
  1.1846 +            }
  1.1847 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1848 +            case SDL_COPY_MASK:
  1.1849 +                if (srcA) {
  1.1850 +                    dstR = srcR;
  1.1851 +                    dstG = srcG;
  1.1852 +                    dstB = srcB;
  1.1853 +                }
  1.1854 +                break;
  1.1855 +            case SDL_COPY_BLEND:
  1.1856 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1857 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1858 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1859 +                break;
  1.1860 +            case SDL_COPY_ADD:
  1.1861 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1862 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1863 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1864 +                break;
  1.1865 +            case SDL_COPY_MOD:
  1.1866 +                dstR = (srcR * dstR) / 255;
  1.1867 +                dstG = (srcG * dstG) / 255;
  1.1868 +                dstB = (srcB * dstB) / 255;
  1.1869 +                break;
  1.1870 +            }
  1.1871 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1872 +            *dst = dstpixel;
  1.1873 +            ++src;
  1.1874 +            ++dst;
  1.1875 +        }
  1.1876 +        info->src += info->src_pitch;
  1.1877 +        info->dst += info->dst_pitch;
  1.1878 +    }
  1.1879 +}
  1.1880 +
  1.1881 +static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
  1.1882 +{
  1.1883 +    const int flags = info->flags;
  1.1884 +    Uint32 srcpixel;
  1.1885 +    Uint32 srcR, srcG, srcB, srcA;
  1.1886 +    Uint32 dstpixel;
  1.1887 +    Uint32 dstR, dstG, dstB, dstA;
  1.1888 +    int srcy, srcx;
  1.1889 +    int posy, posx;
  1.1890 +    int incy, incx;
  1.1891 +
  1.1892 +    srcy = 0;
  1.1893 +    posy = 0;
  1.1894 +    incy = (info->src_h << 16) / info->dst_h;
  1.1895 +    incx = (info->src_w << 16) / info->dst_w;
  1.1896 +
  1.1897 +    while (info->dst_h--) {
  1.1898 +        Uint32 *src;
  1.1899 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1900 +        int n = info->dst_w;
  1.1901 +        srcx = -1;
  1.1902 +        posx = 0x10000L;
  1.1903 +        while (posy >= 0x10000L) {
  1.1904 +            ++srcy;
  1.1905 +            posy -= 0x10000L;
  1.1906 +        }
  1.1907 +        while (n--) {
  1.1908 +            if (posx >= 0x10000L) {
  1.1909 +                while (posx >= 0x10000L) {
  1.1910 +                    ++srcx;
  1.1911 +                    posx -= 0x10000L;
  1.1912 +                }
  1.1913 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1914 +            }
  1.1915 +            srcpixel = *src;
  1.1916 +            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1917 +            dstpixel = *dst;
  1.1918 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1919 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1920 +                /* This goes away if we ever use premultiplied alpha */
  1.1921 +                if (srcA < 255) {
  1.1922 +                    srcR = (srcR * srcA) / 255;
  1.1923 +                    srcG = (srcG * srcA) / 255;
  1.1924 +                    srcB = (srcB * srcA) / 255;
  1.1925 +                }
  1.1926 +            }
  1.1927 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.1928 +            case SDL_COPY_MASK:
  1.1929 +                if (srcA) {
  1.1930 +                    dstR = srcR;
  1.1931 +                    dstG = srcG;
  1.1932 +                    dstB = srcB;
  1.1933 +                }
  1.1934 +                break;
  1.1935 +            case SDL_COPY_BLEND:
  1.1936 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.1937 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.1938 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.1939 +                break;
  1.1940 +            case SDL_COPY_ADD:
  1.1941 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.1942 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.1943 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.1944 +                break;
  1.1945 +            case SDL_COPY_MOD:
  1.1946 +                dstR = (srcR * dstR) / 255;
  1.1947 +                dstG = (srcG * dstG) / 255;
  1.1948 +                dstB = (srcB * dstB) / 255;
  1.1949 +                break;
  1.1950 +            }
  1.1951 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.1952 +            *dst = dstpixel;
  1.1953 +            posx += incx;
  1.1954 +            ++dst;
  1.1955 +        }
  1.1956 +        posy += incy;
  1.1957 +        info->dst += info->dst_pitch;
  1.1958 +    }
  1.1959 +}
  1.1960 +
  1.1961 +static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info)
  1.1962 +{
  1.1963 +    const int flags = info->flags;
  1.1964 +    const Uint32 modulateR = info->r;
  1.1965 +    const Uint32 modulateG = info->g;
  1.1966 +    const Uint32 modulateB = info->b;
  1.1967 +    const Uint32 modulateA = info->a;
  1.1968 +    Uint32 pixel;
  1.1969 +    Uint32 R, G, B, A;
  1.1970 +
  1.1971 +    while (info->dst_h--) {
  1.1972 +        Uint32 *src = (Uint32 *)info->src;
  1.1973 +        Uint32 *dst = (Uint32 *)info->dst;
  1.1974 +        int n = info->dst_w;
  1.1975 +        while (n--) {
  1.1976 +            pixel = *src;
  1.1977 +            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1978 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1979 +                R = (R * modulateR) / 255;
  1.1980 +                G = (G * modulateG) / 255;
  1.1981 +                B = (B * modulateB) / 255;
  1.1982 +            }
  1.1983 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1984 +                A = (A * modulateA) / 255;
  1.1985 +            }
  1.1986 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1987 +            *dst = pixel;
  1.1988 +            ++src;
  1.1989 +            ++dst;
  1.1990 +        }
  1.1991 +        info->src += info->src_pitch;
  1.1992 +        info->dst += info->dst_pitch;
  1.1993 +    }
  1.1994 +}
  1.1995 +
  1.1996 +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
  1.1997 +{
  1.1998 +    const int flags = info->flags;
  1.1999 +    const Uint32 modulateR = info->r;
  1.2000 +    const Uint32 modulateG = info->g;
  1.2001 +    const Uint32 modulateB = info->b;
  1.2002 +    const Uint32 modulateA = info->a;
  1.2003 +    Uint32 pixel;
  1.2004 +    Uint32 R, G, B, A;
  1.2005 +    int srcy, srcx;
  1.2006 +    int posy, posx;
  1.2007 +    int incy, incx;
  1.2008 +
  1.2009 +    srcy = 0;
  1.2010 +    posy = 0;
  1.2011 +    incy = (info->src_h << 16) / info->dst_h;
  1.2012 +    incx = (info->src_w << 16) / info->dst_w;
  1.2013 +
  1.2014 +    while (info->dst_h--) {
  1.2015 +        Uint32 *src;
  1.2016 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2017 +        int n = info->dst_w;
  1.2018 +        srcx = -1;
  1.2019 +        posx = 0x10000L;
  1.2020 +        while (posy >= 0x10000L) {
  1.2021 +            ++srcy;
  1.2022 +            posy -= 0x10000L;
  1.2023 +        }
  1.2024 +        while (n--) {
  1.2025 +            if (posx >= 0x10000L) {
  1.2026 +                while (posx >= 0x10000L) {
  1.2027 +                    ++srcx;
  1.2028 +                    posx -= 0x10000L;
  1.2029 +                }
  1.2030 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.2031 +            }
  1.2032 +            pixel = *src;
  1.2033 +            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.2034 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.2035 +                R = (R * modulateR) / 255;
  1.2036 +                G = (G * modulateG) / 255;
  1.2037 +                B = (B * modulateB) / 255;
  1.2038 +            }
  1.2039 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.2040 +                A = (A * modulateA) / 255;
  1.2041 +            }
  1.2042 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.2043 +            *dst = pixel;
  1.2044 +            posx += incx;
  1.2045 +            ++dst;
  1.2046 +        }
  1.2047 +        posy += incy;
  1.2048 +        info->dst += info->dst_pitch;
  1.2049 +    }
  1.2050 +}
  1.2051 +
  1.2052 +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
  1.2053 +{
  1.2054 +    const int flags = info->flags;
  1.2055 +    const Uint32 modulateR = info->r;
  1.2056 +    const Uint32 modulateG = info->g;
  1.2057 +    const Uint32 modulateB = info->b;
  1.2058 +    const Uint32 modulateA = info->a;
  1.2059 +    Uint32 srcpixel;
  1.2060 +    Uint32 srcR, srcG, srcB, srcA;
  1.2061 +    Uint32 dstpixel;
  1.2062 +    Uint32 dstR, dstG, dstB, dstA;
  1.2063 +
  1.2064 +    while (info->dst_h--) {
  1.2065 +        Uint32 *src = (Uint32 *)info->src;
  1.2066 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2067 +        int n = info->dst_w;
  1.2068 +        while (n--) {
  1.2069 +            srcpixel = *src;
  1.2070 +            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.2071 +            dstpixel = *dst;
  1.2072 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.2073 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.2074 +                srcR = (srcR * modulateR) / 255;
  1.2075 +                srcG = (srcG * modulateG) / 255;
  1.2076 +                srcB = (srcB * modulateB) / 255;
  1.2077 +            }
  1.2078 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.2079 +                srcA = (srcA * modulateA) / 255;
  1.2080 +            }
  1.2081 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.2082 +                /* This goes away if we ever use premultiplied alpha */
  1.2083 +                if (srcA < 255) {
  1.2084 +                    srcR = (srcR * srcA) / 255;
  1.2085 +                    srcG = (srcG * srcA) / 255;
  1.2086 +                    srcB = (srcB * srcA) / 255;
  1.2087 +                }
  1.2088 +            }
  1.2089 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.2090 +            case SDL_COPY_MASK:
  1.2091 +                if (srcA) {
  1.2092 +                    dstR = srcR;
  1.2093 +                    dstG = srcG;
  1.2094 +                    dstB = srcB;
  1.2095 +                }
  1.2096 +                break;
  1.2097 +            case SDL_COPY_BLEND:
  1.2098 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.2099 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.2100 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.2101 +                break;
  1.2102 +            case SDL_COPY_ADD:
  1.2103 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.2104 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.2105 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.2106 +                break;
  1.2107 +            case SDL_COPY_MOD:
  1.2108 +                dstR = (srcR * dstR) / 255;
  1.2109 +                dstG = (srcG * dstG) / 255;
  1.2110 +                dstB = (srcB * dstB) / 255;
  1.2111 +                break;
  1.2112 +            }
  1.2113 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.2114 +            *dst = dstpixel;
  1.2115 +            ++src;
  1.2116 +            ++dst;
  1.2117 +        }
  1.2118 +        info->src += info->src_pitch;
  1.2119 +        info->dst += info->dst_pitch;
  1.2120 +    }
  1.2121 +}
  1.2122 +
  1.2123 +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
  1.2124 +{
  1.2125 +    const int flags = info->flags;
  1.2126 +    const Uint32 modulateR = info->r;
  1.2127 +    const Uint32 modulateG = info->g;
  1.2128 +    const Uint32 modulateB = info->b;
  1.2129 +    const Uint32 modulateA = info->a;
  1.2130 +    Uint32 srcpixel;
  1.2131 +    Uint32 srcR, srcG, srcB, srcA;
  1.2132 +    Uint32 dstpixel;
  1.2133 +    Uint32 dstR, dstG, dstB, dstA;
  1.2134 +    int srcy, srcx;
  1.2135 +    int posy, posx;
  1.2136 +    int incy, incx;
  1.2137 +
  1.2138 +    srcy = 0;
  1.2139 +    posy = 0;
  1.2140 +    incy = (info->src_h << 16) / info->dst_h;
  1.2141 +    incx = (info->src_w << 16) / info->dst_w;
  1.2142 +
  1.2143 +    while (info->dst_h--) {
  1.2144 +        Uint32 *src;
  1.2145 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2146 +        int n = info->dst_w;
  1.2147 +        srcx = -1;
  1.2148 +        posx = 0x10000L;
  1.2149 +        while (posy >= 0x10000L) {
  1.2150 +            ++srcy;
  1.2151 +            posy -= 0x10000L;
  1.2152 +        }
  1.2153 +        while (n--) {
  1.2154 +            if (posx >= 0x10000L) {
  1.2155 +                while (posx >= 0x10000L) {
  1.2156 +                    ++srcx;
  1.2157 +                    posx -= 0x10000L;
  1.2158 +                }
  1.2159 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.2160 +            }
  1.2161 +            srcpixel = *src;
  1.2162 +            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.2163 +            dstpixel = *dst;
  1.2164 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.2165 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.2166 +                srcR = (srcR * modulateR) / 255;
  1.2167 +                srcG = (srcG * modulateG) / 255;
  1.2168 +                srcB = (srcB * modulateB) / 255;
  1.2169 +            }
  1.2170 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.2171 +                srcA = (srcA * modulateA) / 255;
  1.2172 +            }
  1.2173 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.2174 +                /* This goes away if we ever use premultiplied alpha */
  1.2175 +                if (srcA < 255) {
  1.2176 +                    srcR = (srcR * srcA) / 255;
  1.2177 +                    srcG = (srcG * srcA) / 255;
  1.2178 +                    srcB = (srcB * srcA) / 255;
  1.2179 +                }
  1.2180 +            }
  1.2181 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.2182 +            case SDL_COPY_MASK:
  1.2183 +                if (srcA) {
  1.2184 +                    dstR = srcR;
  1.2185 +                    dstG = srcG;
  1.2186 +                    dstB = srcB;
  1.2187 +                }
  1.2188 +                break;
  1.2189 +            case SDL_COPY_BLEND:
  1.2190 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.2191 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.2192 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.2193 +                break;
  1.2194 +            case SDL_COPY_ADD:
  1.2195 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.2196 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.2197 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.2198 +                break;
  1.2199 +            case SDL_COPY_MOD:
  1.2200 +                dstR = (srcR * dstR) / 255;
  1.2201 +                dstG = (srcG * dstG) / 255;
  1.2202 +                dstB = (srcB * dstB) / 255;
  1.2203 +                break;
  1.2204 +            }
  1.2205 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.2206 +            *dst = dstpixel;
  1.2207 +            posx += incx;
  1.2208 +            ++dst;
  1.2209 +        }
  1.2210 +        posy += incy;
  1.2211 +        info->dst += info->dst_pitch;
  1.2212 +    }
  1.2213 +}
  1.2214 +
  1.2215  static void SDL_Blit_BGRA8888_RGB888_Scale(SDL_BlitInfo *info)
  1.2216  {
  1.2217      const int flags = info->flags;
  1.2218 @@ -5262,6 +7442,443 @@
  1.2219      }
  1.2220  }
  1.2221  
  1.2222 +static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info)
  1.2223 +{
  1.2224 +    const int flags = info->flags;
  1.2225 +    Uint32 pixel;
  1.2226 +    Uint32 R, G, B, A;
  1.2227 +    int srcy, srcx;
  1.2228 +    int posy, posx;
  1.2229 +    int incy, incx;
  1.2230 +
  1.2231 +    srcy = 0;
  1.2232 +    posy = 0;
  1.2233 +    incy = (info->src_h << 16) / info->dst_h;
  1.2234 +    incx = (info->src_w << 16) / info->dst_w;
  1.2235 +
  1.2236 +    while (info->dst_h--) {
  1.2237 +        Uint32 *src;
  1.2238 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2239 +        int n = info->dst_w;
  1.2240 +        srcx = -1;
  1.2241 +        posx = 0x10000L;
  1.2242 +        while (posy >= 0x10000L) {
  1.2243 +            ++srcy;
  1.2244 +            posy -= 0x10000L;
  1.2245 +        }
  1.2246 +        while (n--) {
  1.2247 +            if (posx >= 0x10000L) {
  1.2248 +                while (posx >= 0x10000L) {
  1.2249 +                    ++srcx;
  1.2250 +                    posx -= 0x10000L;
  1.2251 +                }
  1.2252 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.2253 +            }
  1.2254 +            pixel = *src;
  1.2255 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.2256 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.2257 +            *dst = pixel;
  1.2258 +            posx += incx;
  1.2259 +            ++dst;
  1.2260 +        }
  1.2261 +        posy += incy;
  1.2262 +        info->dst += info->dst_pitch;
  1.2263 +    }
  1.2264 +}
  1.2265 +
  1.2266 +static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info)
  1.2267 +{
  1.2268 +    const int flags = info->flags;
  1.2269 +    Uint32 srcpixel;
  1.2270 +    Uint32 srcR, srcG, srcB, srcA;
  1.2271 +    Uint32 dstpixel;
  1.2272 +    Uint32 dstR, dstG, dstB, dstA;
  1.2273 +
  1.2274 +    while (info->dst_h--) {
  1.2275 +        Uint32 *src = (Uint32 *)info->src;
  1.2276 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2277 +        int n = info->dst_w;
  1.2278 +        while (n--) {
  1.2279 +            srcpixel = *src;
  1.2280 +            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.2281 +            dstpixel = *dst;
  1.2282 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.2283 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.2284 +                /* This goes away if we ever use premultiplied alpha */
  1.2285 +                if (srcA < 255) {
  1.2286 +                    srcR = (srcR * srcA) / 255;
  1.2287 +                    srcG = (srcG * srcA) / 255;
  1.2288 +                    srcB = (srcB * srcA) / 255;
  1.2289 +                }
  1.2290 +            }
  1.2291 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.2292 +            case SDL_COPY_MASK:
  1.2293 +                if (srcA) {
  1.2294 +                    dstR = srcR;
  1.2295 +                    dstG = srcG;
  1.2296 +                    dstB = srcB;
  1.2297 +                }
  1.2298 +                break;
  1.2299 +            case SDL_COPY_BLEND:
  1.2300 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.2301 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.2302 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.2303 +                break;
  1.2304 +            case SDL_COPY_ADD:
  1.2305 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.2306 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.2307 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.2308 +                break;
  1.2309 +            case SDL_COPY_MOD:
  1.2310 +                dstR = (srcR * dstR) / 255;
  1.2311 +                dstG = (srcG * dstG) / 255;
  1.2312 +                dstB = (srcB * dstB) / 255;
  1.2313 +                break;
  1.2314 +            }
  1.2315 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.2316 +            *dst = dstpixel;
  1.2317 +            ++src;
  1.2318 +            ++dst;
  1.2319 +        }
  1.2320 +        info->src += info->src_pitch;
  1.2321 +        info->dst += info->dst_pitch;
  1.2322 +    }
  1.2323 +}
  1.2324 +
  1.2325 +static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
  1.2326 +{
  1.2327 +    const int flags = info->flags;
  1.2328 +    Uint32 srcpixel;
  1.2329 +    Uint32 srcR, srcG, srcB, srcA;
  1.2330 +    Uint32 dstpixel;
  1.2331 +    Uint32 dstR, dstG, dstB, dstA;
  1.2332 +    int srcy, srcx;
  1.2333 +    int posy, posx;
  1.2334 +    int incy, incx;
  1.2335 +
  1.2336 +    srcy = 0;
  1.2337 +    posy = 0;
  1.2338 +    incy = (info->src_h << 16) / info->dst_h;
  1.2339 +    incx = (info->src_w << 16) / info->dst_w;
  1.2340 +
  1.2341 +    while (info->dst_h--) {
  1.2342 +        Uint32 *src;
  1.2343 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2344 +        int n = info->dst_w;
  1.2345 +        srcx = -1;
  1.2346 +        posx = 0x10000L;
  1.2347 +        while (posy >= 0x10000L) {
  1.2348 +            ++srcy;
  1.2349 +            posy -= 0x10000L;
  1.2350 +        }
  1.2351 +        while (n--) {
  1.2352 +            if (posx >= 0x10000L) {
  1.2353 +                while (posx >= 0x10000L) {
  1.2354 +                    ++srcx;
  1.2355 +                    posx -= 0x10000L;
  1.2356 +                }
  1.2357 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.2358 +            }
  1.2359 +            srcpixel = *src;
  1.2360 +            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.2361 +            dstpixel = *dst;
  1.2362 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.2363 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.2364 +                /* This goes away if we ever use premultiplied alpha */
  1.2365 +                if (srcA < 255) {
  1.2366 +                    srcR = (srcR * srcA) / 255;
  1.2367 +                    srcG = (srcG * srcA) / 255;
  1.2368 +                    srcB = (srcB * srcA) / 255;
  1.2369 +                }
  1.2370 +            }
  1.2371 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.2372 +            case SDL_COPY_MASK:
  1.2373 +                if (srcA) {
  1.2374 +                    dstR = srcR;
  1.2375 +                    dstG = srcG;
  1.2376 +                    dstB = srcB;
  1.2377 +                }
  1.2378 +                break;
  1.2379 +            case SDL_COPY_BLEND:
  1.2380 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.2381 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.2382 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.2383 +                break;
  1.2384 +            case SDL_COPY_ADD:
  1.2385 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.2386 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.2387 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.2388 +                break;
  1.2389 +            case SDL_COPY_MOD:
  1.2390 +                dstR = (srcR * dstR) / 255;
  1.2391 +                dstG = (srcG * dstG) / 255;
  1.2392 +                dstB = (srcB * dstB) / 255;
  1.2393 +                break;
  1.2394 +            }
  1.2395 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.2396 +            *dst = dstpixel;
  1.2397 +            posx += incx;
  1.2398 +            ++dst;
  1.2399 +        }
  1.2400 +        posy += incy;
  1.2401 +        info->dst += info->dst_pitch;
  1.2402 +    }
  1.2403 +}
  1.2404 +
  1.2405 +static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
  1.2406 +{
  1.2407 +    const int flags = info->flags;
  1.2408 +    const Uint32 modulateR = info->r;
  1.2409 +    const Uint32 modulateG = info->g;
  1.2410 +    const Uint32 modulateB = info->b;
  1.2411 +    const Uint32 modulateA = info->a;
  1.2412 +    Uint32 pixel;
  1.2413 +    Uint32 R, G, B, A;
  1.2414 +
  1.2415 +    while (info->dst_h--) {
  1.2416 +        Uint32 *src = (Uint32 *)info->src;
  1.2417 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2418 +        int n = info->dst_w;
  1.2419 +        while (n--) {
  1.2420 +            pixel = *src;
  1.2421 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.2422 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.2423 +                R = (R * modulateR) / 255;
  1.2424 +                G = (G * modulateG) / 255;
  1.2425 +                B = (B * modulateB) / 255;
  1.2426 +            }
  1.2427 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.2428 +                A = (A * modulateA) / 255;
  1.2429 +            }
  1.2430 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.2431 +            *dst = pixel;
  1.2432 +            ++src;
  1.2433 +            ++dst;
  1.2434 +        }
  1.2435 +        info->src += info->src_pitch;
  1.2436 +        info->dst += info->dst_pitch;
  1.2437 +    }
  1.2438 +}
  1.2439 +
  1.2440 +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
  1.2441 +{
  1.2442 +    const int flags = info->flags;
  1.2443 +    const Uint32 modulateR = info->r;
  1.2444 +    const Uint32 modulateG = info->g;
  1.2445 +    const Uint32 modulateB = info->b;
  1.2446 +    const Uint32 modulateA = info->a;
  1.2447 +    Uint32 pixel;
  1.2448 +    Uint32 R, G, B, A;
  1.2449 +    int srcy, srcx;
  1.2450 +    int posy, posx;
  1.2451 +    int incy, incx;
  1.2452 +
  1.2453 +    srcy = 0;
  1.2454 +    posy = 0;
  1.2455 +    incy = (info->src_h << 16) / info->dst_h;
  1.2456 +    incx = (info->src_w << 16) / info->dst_w;
  1.2457 +
  1.2458 +    while (info->dst_h--) {
  1.2459 +        Uint32 *src;
  1.2460 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2461 +        int n = info->dst_w;
  1.2462 +        srcx = -1;
  1.2463 +        posx = 0x10000L;
  1.2464 +        while (posy >= 0x10000L) {
  1.2465 +            ++srcy;
  1.2466 +            posy -= 0x10000L;
  1.2467 +        }
  1.2468 +        while (n--) {
  1.2469 +            if (posx >= 0x10000L) {
  1.2470 +                while (posx >= 0x10000L) {
  1.2471 +                    ++srcx;
  1.2472 +                    posx -= 0x10000L;
  1.2473 +                }
  1.2474 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.2475 +            }
  1.2476 +            pixel = *src;
  1.2477 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.2478 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.2479 +                R = (R * modulateR) / 255;
  1.2480 +                G = (G * modulateG) / 255;
  1.2481 +                B = (B * modulateB) / 255;
  1.2482 +            }
  1.2483 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.2484 +                A = (A * modulateA) / 255;
  1.2485 +            }
  1.2486 +            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.2487 +            *dst = pixel;
  1.2488 +            posx += incx;
  1.2489 +            ++dst;
  1.2490 +        }
  1.2491 +        posy += incy;
  1.2492 +        info->dst += info->dst_pitch;
  1.2493 +    }
  1.2494 +}
  1.2495 +
  1.2496 +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
  1.2497 +{
  1.2498 +    const int flags = info->flags;
  1.2499 +    const Uint32 modulateR = info->r;
  1.2500 +    const Uint32 modulateG = info->g;
  1.2501 +    const Uint32 modulateB = info->b;
  1.2502 +    const Uint32 modulateA = info->a;
  1.2503 +    Uint32 srcpixel;
  1.2504 +    Uint32 srcR, srcG, srcB, srcA;
  1.2505 +    Uint32 dstpixel;
  1.2506 +    Uint32 dstR, dstG, dstB, dstA;
  1.2507 +
  1.2508 +    while (info->dst_h--) {
  1.2509 +        Uint32 *src = (Uint32 *)info->src;
  1.2510 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2511 +        int n = info->dst_w;
  1.2512 +        while (n--) {
  1.2513 +            srcpixel = *src;
  1.2514 +            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.2515 +            dstpixel = *dst;
  1.2516 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.2517 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.2518 +                srcR = (srcR * modulateR) / 255;
  1.2519 +                srcG = (srcG * modulateG) / 255;
  1.2520 +                srcB = (srcB * modulateB) / 255;
  1.2521 +            }
  1.2522 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.2523 +                srcA = (srcA * modulateA) / 255;
  1.2524 +            }
  1.2525 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.2526 +                /* This goes away if we ever use premultiplied alpha */
  1.2527 +                if (srcA < 255) {
  1.2528 +                    srcR = (srcR * srcA) / 255;
  1.2529 +                    srcG = (srcG * srcA) / 255;
  1.2530 +                    srcB = (srcB * srcA) / 255;
  1.2531 +                }
  1.2532 +            }
  1.2533 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.2534 +            case SDL_COPY_MASK:
  1.2535 +                if (srcA) {
  1.2536 +                    dstR = srcR;
  1.2537 +                    dstG = srcG;
  1.2538 +                    dstB = srcB;
  1.2539 +                }
  1.2540 +                break;
  1.2541 +            case SDL_COPY_BLEND:
  1.2542 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.2543 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.2544 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.2545 +                break;
  1.2546 +            case SDL_COPY_ADD:
  1.2547 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.2548 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.2549 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.2550 +                break;
  1.2551 +            case SDL_COPY_MOD:
  1.2552 +                dstR = (srcR * dstR) / 255;
  1.2553 +                dstG = (srcG * dstG) / 255;
  1.2554 +                dstB = (srcB * dstB) / 255;
  1.2555 +                break;
  1.2556 +            }
  1.2557 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.2558 +            *dst = dstpixel;
  1.2559 +            ++src;
  1.2560 +            ++dst;
  1.2561 +        }
  1.2562 +        info->src += info->src_pitch;
  1.2563 +        info->dst += info->dst_pitch;
  1.2564 +    }
  1.2565 +}
  1.2566 +
  1.2567 +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
  1.2568 +{
  1.2569 +    const int flags = info->flags;
  1.2570 +    const Uint32 modulateR = info->r;
  1.2571 +    const Uint32 modulateG = info->g;
  1.2572 +    const Uint32 modulateB = info->b;
  1.2573 +    const Uint32 modulateA = info->a;
  1.2574 +    Uint32 srcpixel;
  1.2575 +    Uint32 srcR, srcG, srcB, srcA;
  1.2576 +    Uint32 dstpixel;
  1.2577 +    Uint32 dstR, dstG, dstB, dstA;
  1.2578 +    int srcy, srcx;
  1.2579 +    int posy, posx;
  1.2580 +    int incy, incx;
  1.2581 +
  1.2582 +    srcy = 0;
  1.2583 +    posy = 0;
  1.2584 +    incy = (info->src_h << 16) / info->dst_h;
  1.2585 +    incx = (info->src_w << 16) / info->dst_w;
  1.2586 +
  1.2587 +    while (info->dst_h--) {
  1.2588 +        Uint32 *src;
  1.2589 +        Uint32 *dst = (Uint32 *)info->dst;
  1.2590 +        int n = info->dst_w;
  1.2591 +        srcx = -1;
  1.2592 +        posx = 0x10000L;
  1.2593 +        while (posy >= 0x10000L) {
  1.2594 +            ++srcy;
  1.2595 +            posy -= 0x10000L;
  1.2596 +        }
  1.2597 +        while (n--) {
  1.2598 +            if (posx >= 0x10000L) {
  1.2599 +                while (posx >= 0x10000L) {
  1.2600 +                    ++srcx;
  1.2601 +                    posx -= 0x10000L;
  1.2602 +                }
  1.2603 +                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.2604 +            }
  1.2605 +            srcpixel = *src;
  1.2606 +            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.2607 +            dstpixel = *dst;
  1.2608 +            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.2609 +            if (flags & SDL_COPY_MODULATE_COLOR) {
  1.2610 +                srcR = (srcR * modulateR) / 255;
  1.2611 +                srcG = (srcG * modulateG) / 255;
  1.2612 +                srcB = (srcB * modulateB) / 255;
  1.2613 +            }
  1.2614 +            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.2615 +                srcA = (srcA * modulateA) / 255;
  1.2616 +            }
  1.2617 +            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.2618 +                /* This goes away if we ever use premultiplied alpha */
  1.2619 +                if (srcA < 255) {
  1.2620 +                    srcR = (srcR * srcA) / 255;
  1.2621 +                    srcG = (srcG * srcA) / 255;
  1.2622 +                    srcB = (srcB * srcA) / 255;
  1.2623 +                }
  1.2624 +            }
  1.2625 +            switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  1.2626 +            case SDL_COPY_MASK:
  1.2627 +                if (srcA) {
  1.2628 +                    dstR = srcR;
  1.2629 +                    dstG = srcG;
  1.2630 +                    dstB = srcB;
  1.2631 +                }
  1.2632 +                break;
  1.2633 +            case SDL_COPY_BLEND:
  1.2634 +                dstR = srcR + ((255 - srcA) * dstR) / 255;
  1.2635 +                dstG = srcG + ((255 - srcA) * dstG) / 255;
  1.2636 +                dstB = srcB + ((255 - srcA) * dstB) / 255;
  1.2637 +                break;
  1.2638 +            case SDL_COPY_ADD:
  1.2639 +                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
  1.2640 +                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
  1.2641 +                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
  1.2642 +                break;
  1.2643 +            case SDL_COPY_MOD:
  1.2644 +                dstR = (srcR * dstR) / 255;
  1.2645 +                dstG = (srcG * dstG) / 255;
  1.2646 +                dstB = (srcB * dstB) / 255;
  1.2647 +                break;
  1.2648 +            }
  1.2649 +            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
  1.2650 +            *dst = dstpixel;
  1.2651 +            posx += incx;
  1.2652 +            ++dst;
  1.2653 +        }
  1.2654 +        posy += incy;
  1.2655 +        info->dst += info->dst_pitch;
  1.2656 +    }
  1.2657 +}
  1.2658 +
  1.2659  SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = {
  1.2660      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Scale },
  1.2661      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend },
  1.2662 @@ -5277,6 +7894,13 @@
  1.2663      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Scale },
  1.2664      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend },
  1.2665      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale },
  1.2666 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Scale },
  1.2667 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend },
  1.2668 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend_Scale },
  1.2669 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate },
  1.2670 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Scale },
  1.2671 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend },
  1.2672 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale },
  1.2673      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Scale },
  1.2674      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend },
  1.2675      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend_Scale },
  1.2676 @@ -5291,6 +7915,13 @@
  1.2677      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Scale },
  1.2678      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend },
  1.2679      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale },
  1.2680 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Scale },
  1.2681 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend },
  1.2682 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend_Scale },
  1.2683 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate },
  1.2684 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Scale },
  1.2685 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend },
  1.2686 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale },
  1.2687      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Scale },
  1.2688      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend },
  1.2689      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend_Scale },
  1.2690 @@ -5305,6 +7936,13 @@
  1.2691      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Scale },
  1.2692      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend },
  1.2693      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale },
  1.2694 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Scale },
  1.2695 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend },
  1.2696 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend_Scale },
  1.2697 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate },
  1.2698 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale },
  1.2699 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend },
  1.2700 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale },
  1.2701      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Scale },
  1.2702      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend },
  1.2703      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend_Scale },
  1.2704 @@ -5319,6 +7957,13 @@
  1.2705      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Scale },
  1.2706      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend },
  1.2707      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale },
  1.2708 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Scale },
  1.2709 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend },
  1.2710 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend_Scale },
  1.2711 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate },
  1.2712 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale },
  1.2713 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend },
  1.2714 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale },
  1.2715      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Scale },
  1.2716      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend },
  1.2717      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend_Scale },
  1.2718 @@ -5333,6 +7978,13 @@
  1.2719      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Scale },
  1.2720      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend },
  1.2721      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale },
  1.2722 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Scale },
  1.2723 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend },
  1.2724 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend_Scale },
  1.2725 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate },
  1.2726 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale },
  1.2727 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend },
  1.2728 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale },
  1.2729      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Scale },
  1.2730      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend },
  1.2731      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend_Scale },
  1.2732 @@ -5347,6 +7999,13 @@
  1.2733      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Scale },
  1.2734      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend },
  1.2735      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale },
  1.2736 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Scale },
  1.2737 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend },
  1.2738 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend_Scale },
  1.2739 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate },
  1.2740 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale },
  1.2741 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend },
  1.2742 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale },
  1.2743      { 0, 0, 0, 0, NULL }
  1.2744  };
  1.2745