Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed alpha composition when destination alpha is transparent.
Jianyu Guan

I found I make a big mistake that when dstA==0, I just simply let *dstp=*srcp and forgot to make dstRGB = srcRGB*srcA.

The if consition "(*dstp & amask) == 0" in BlitRGBtoRGBPixelAlphaMMX and BlitRGBtoRGBPixelAlphaMMX3dNow should be removed.
  • Loading branch information
slouken committed Aug 16, 2013
1 parent 89bc80f commit 76b7b1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/SDL_blit_A.c
Expand Up @@ -352,7 +352,7 @@ BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info)
Uint32 alpha = *srcp & amask;
if (alpha == 0) {
/* do nothing */
} else if (alpha == amask || (*dstp & amask) == 0) {
} else if (alpha == amask) {
*dstp = *srcp;
} else {
src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB)*/
Expand Down Expand Up @@ -545,7 +545,7 @@ BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo * info)
alpha = *srcp & amask;
if (alpha == 0) {
/* do nothing */
} else if (alpha == amask || (*dstp & amask) == 0) {
} else if (alpha == amask) {
*dstp = *srcp;
} else {
src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB)*/
Expand Down

0 comments on commit 76b7b1e

Please sign in to comment.