$OpenBSD: patch-src_video_SDL_blit_N_c,v 1.1 2012/03/02 09:10:38 dcoppa Exp $

Fixed bug 1424 - Handling of alpha channel in Altivec accelerated blit functions

--- src/video/SDL_blit_N.c.orig	Wed Feb 22 19:36:49 2012
+++ src/video/SDL_blit_N.c	Wed Feb 22 19:38:46 2012
@@ -689,6 +689,8 @@ static void ConvertAltivec32to32_noprefetch(SDL_BlitIn
         while ((UNALIGNED_PTR(dst)) && (width)) {
             bits = *(src++);
             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
+            if(!srcfmt->Amask)
+              a = srcfmt->alpha;
             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
             width--;
         }
@@ -716,6 +718,8 @@ static void ConvertAltivec32to32_noprefetch(SDL_BlitIn
         while (extrawidth) {
             bits = *(src++);  /* max 7 pixels, don't bother with prefetch. */
             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
+            if(!srcfmt->Amask)
+              a = srcfmt->alpha;
             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
             extrawidth--;
         }
@@ -769,6 +773,8 @@ static void ConvertAltivec32to32_prefetch(SDL_BlitInfo
             vec_dstst(dst+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
             bits = *(src++);
             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
+            if(!srcfmt->Amask)
+              a = srcfmt->alpha;
             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
             width--;
         }
@@ -798,6 +804,8 @@ static void ConvertAltivec32to32_prefetch(SDL_BlitInfo
         while (extrawidth) {
             bits = *(src++);  /* max 7 pixels, don't bother with prefetch. */
             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
+            if(!srcfmt->Amask)
+              a = srcfmt->alpha;
             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
             extrawidth--;
         }
