Mercurial > sdl-ios-xcode
comparison src/video/SDL_blit_A.c @ 2698:e1da92da346c gsoc2008_nds
Clean up.
author | Darren Alton <dalton@stevens.edu> |
---|---|
date | Wed, 27 Aug 2008 04:23:38 +0000 |
parents | dc3dd3a0bf02 |
children | 6258fa7cd300 |
comparison
equal
deleted
inserted
replaced
2697:c9121b04cffa | 2698:e1da92da346c |
---|---|
281 mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ | 281 mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ |
282 /* form the alpha mult */ | 282 /* form the alpha mult */ |
283 amult = alpha | (alpha << 8); | 283 amult = alpha | (alpha << 8); |
284 amult = amult | (amult << 16); | 284 amult = amult | (amult << 16); |
285 chanmask = | 285 chanmask = |
286 (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df-> | 286 (0xff << df->Rshift) | (0xff << df-> |
287 Bshift); | 287 Gshift) | (0xff << df->Bshift); |
288 mm_alpha = _mm_set_pi32(0, amult & chanmask); /* 0000AAAA -> mm_alpha, minus 1 chan */ | 288 mm_alpha = _mm_set_pi32(0, amult & chanmask); /* 0000AAAA -> mm_alpha, minus 1 chan */ |
289 mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */ | 289 mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */ |
290 /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */ | 290 /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */ |
291 dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ | 291 dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ |
292 | 292 |
524 Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift); | 524 Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift); |
525 Uint32 amask; | 525 Uint32 amask; |
526 /* Use zero for alpha if either surface doesn't have alpha */ | 526 /* Use zero for alpha if either surface doesn't have alpha */ |
527 if (dstfmt->Amask) { | 527 if (dstfmt->Amask) { |
528 amask = | 528 amask = |
529 ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt-> | 529 ((srcfmt->Amask) ? RESHIFT(srcfmt-> |
530 Ashift); | 530 Ashift) : 0x10) << (dstfmt->Ashift); |
531 } else { | 531 } else { |
532 amask = | 532 amask = |
533 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ | 533 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ |
534 0xFFFFFFFF); | 534 0xFFFFFFFF); |
535 } | 535 } |