src/video/SDL_blit_A.c
branchSDL-1.2
changeset 13221 3705e81df6ff
parent 13220 0ae1ddca5e85
     1.1 --- a/src/video/SDL_blit_A.c	Thu Oct 31 14:00:28 2019 +0300
     1.2 +++ b/src/video/SDL_blit_A.c	Thu Oct 31 14:00:28 2019 +0300
     1.3 @@ -1464,6 +1464,20 @@
     1.4  #endif
     1.5  
     1.6  #if SDL_ARM_NEON_BLITTERS
     1.7 +void BlitARGBto565PixelAlphaARMNEONAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride);
     1.8 +
     1.9 +static void BlitARGBto565PixelAlphaARMNEON(SDL_BlitInfo *info)
    1.10 +{
    1.11 +    int32_t width = info->d_width;
    1.12 +    int32_t height = info->d_height;
    1.13 +    uint16_t *dstp = (uint16_t *)info->d_pixels;
    1.14 +    int32_t dststride = width + (info->d_skip >> 1);
    1.15 +    uint32_t *srcp = (uint32_t *)info->s_pixels;
    1.16 +    int32_t srcstride = width + (info->s_skip >> 2);
    1.17 +
    1.18 +    BlitARGBto565PixelAlphaARMNEONAsm(width, height, dstp, dststride, srcp, srcstride);
    1.19 +}
    1.20 +
    1.21  void BlitRGBtoRGBPixelAlphaARMNEONAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride);
    1.22  
    1.23  static void BlitRGBtoRGBPixelAlphaARMNEON(SDL_BlitInfo *info)
    1.24 @@ -2862,14 +2876,21 @@
    1.25              return Blit32to565PixelAlphaAltivec;
    1.26          else
    1.27  #endif
    1.28 -#if SDL_ARM_SIMD_BLITTERS
    1.29 +#if SDL_ARM_NEON_BLITTERS || SDL_ARM_SIMD_BLITTERS
    1.30  		if(sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
    1.31  		   && sf->Gmask == 0xff00 && df->Gmask == 0x7e0
    1.32  		   && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
    1.33 -		   || (sf->Bmask == 0xff && df->Bmask == 0x1f))
    1.34 -		   && SDL_HasARMSIMD())
    1.35 -			return BlitARGBto565PixelAlphaARMSIMD;
    1.36 -		else
    1.37 +		   || (sf->Bmask == 0xff && df->Bmask == 0x1f)))
    1.38 +		{
    1.39 +#if SDL_ARM_NEON_BLITTERS
    1.40 +		    if(SDL_HasARMNEON())
    1.41 +		        return BlitARGBto565PixelAlphaARMNEON;
    1.42 +#endif
    1.43 +#if SDL_ARM_SIMD_BLITTERS
    1.44 +		    if(SDL_HasARMSIMD())
    1.45 +		        return BlitARGBto565PixelAlphaARMSIMD;
    1.46 +#endif
    1.47 +		}
    1.48  #endif
    1.49  	    if(sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
    1.50  	       && sf->Gmask == 0xff00