X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvideo%2FSDL_blit_A.c;h=5a4cff002a49f8cf089d8b28215034d9f7f9c70d;hb=a1f340810c4f9a4a617f1757d1ff0255e0e3fe58;hp=2c52209e647908f98e967b13466a1bbaecaa5783;hpb=5848b0cd8faa53ce16300c4cca06cdb6d42dcc1d;p=sdl_omap.git diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 2c52209..5a4cff0 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -61,6 +61,32 @@ /* Functions to perform alpha blended blitting */ +#ifdef __ARM_NEON__ + +/* NEON optimized blitter callers */ +#define make_neon_caller(name, neon_name) \ +extern void neon_name(void *dst, const void *src, int count); \ +static void name(SDL_BlitInfo *info) \ +{ \ + int width = info->d_width; \ + int height = info->d_height; \ + Uint8 *src = info->s_pixels; \ + Uint8 *dst = info->d_pixels; \ + int srcskip = info->s_skip; \ + int dstskip = info->d_skip; \ +\ + while ( height-- ) { \ + neon_name(dst, src, width); \ + src += width * 4 + srcskip; \ + dst += width * 4 + dstskip; \ + } \ +} + +make_neon_caller(BlitABGRtoXRGBalpha_neon, neon_ABGRtoXRGBalpha) +make_neon_caller(BlitARGBtoXRGBalpha_neon, neon_ARGBtoXRGBalpha) + +#endif /* __ARM_NEON__ */ + /* N->1 blending with per-surface alpha */ static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info) { @@ -2879,10 +2905,21 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) if(!(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) return BlitRGBtoRGBPixelAlphaAltivec; +#endif +#ifdef __ARM_NEON__ + return BlitARGBtoXRGBalpha_neon; #endif return BlitRGBtoRGBPixelAlpha; } } +#ifdef __ARM_NEON__ + if (sf->Gmask == df->Gmask && sf->Amask == 0xff000000 && + ((sf->Rmask == 0xff && df->Rmask == 0xff0000 && sf->Bmask == 0xff0000 && df->Bmask == 0xff) || + (sf->Rmask == 0xff0000 && df->Rmask == 0xff && sf->Bmask == 0xff && df->Bmask == 0xff0000))) + { + return BlitABGRtoXRGBalpha_neon; + } +#endif #if SDL_ALTIVEC_BLITTERS if (sf->Amask && sf->BytesPerPixel == 4 && !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())