src/video/SDL_blit_N.c
branchSDL-1.2
changeset 6294 7a2e0f7b30cb
parent 6137 4720145f848b
child 6411 ec7ccf5ee3dd
equal deleted inserted replaced
6293:57a55e457ef6 6294:7a2e0f7b30cb
   687 
   687 
   688         /* do scalar until we can align... */
   688         /* do scalar until we can align... */
   689         while ((UNALIGNED_PTR(dst)) && (width)) {
   689         while ((UNALIGNED_PTR(dst)) && (width)) {
   690             bits = *(src++);
   690             bits = *(src++);
   691             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
   691             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
       
   692             if(!srcfmt->Amask)
       
   693               a = srcfmt->alpha;
   692             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   694             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   693             width--;
   695             width--;
   694         }
   696         }
   695 
   697 
   696         /* After all that work, here's the vector part! */
   698         /* After all that work, here's the vector part! */
   714 
   716 
   715         /* cover pixels at the end of the row that didn't fit in 16 bytes. */
   717         /* cover pixels at the end of the row that didn't fit in 16 bytes. */
   716         while (extrawidth) {
   718         while (extrawidth) {
   717             bits = *(src++);  /* max 7 pixels, don't bother with prefetch. */
   719             bits = *(src++);  /* max 7 pixels, don't bother with prefetch. */
   718             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
   720             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
       
   721             if(!srcfmt->Amask)
       
   722               a = srcfmt->alpha;
   719             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   723             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   720             extrawidth--;
   724             extrawidth--;
   721         }
   725         }
   722 
   726 
   723         src += srcskip >> 2;  /* move to next row, accounting for pitch. */
   727         src += srcskip >> 2;  /* move to next row, accounting for pitch. */
   767         while ((UNALIGNED_PTR(dst)) && (width)) {
   771         while ((UNALIGNED_PTR(dst)) && (width)) {
   768             vec_dstt(src+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC);
   772             vec_dstt(src+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC);
   769             vec_dstst(dst+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
   773             vec_dstst(dst+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
   770             bits = *(src++);
   774             bits = *(src++);
   771             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
   775             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
       
   776             if(!srcfmt->Amask)
       
   777               a = srcfmt->alpha;
   772             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   778             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   773             width--;
   779             width--;
   774         }
   780         }
   775 
   781 
   776         /* After all that work, here's the vector part! */
   782         /* After all that work, here's the vector part! */
   796 
   802 
   797         /* cover pixels at the end of the row that didn't fit in 16 bytes. */
   803         /* cover pixels at the end of the row that didn't fit in 16 bytes. */
   798         while (extrawidth) {
   804         while (extrawidth) {
   799             bits = *(src++);  /* max 7 pixels, don't bother with prefetch. */
   805             bits = *(src++);  /* max 7 pixels, don't bother with prefetch. */
   800             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
   806             RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
       
   807             if(!srcfmt->Amask)
       
   808               a = srcfmt->alpha;
   801             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   809             *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   802             extrawidth--;
   810             extrawidth--;
   803         }
   811         }
   804 
   812 
   805         src += srcskip >> 2;  /* move to next row, accounting for pitch. */
   813         src += srcskip >> 2;  /* move to next row, accounting for pitch. */