mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
blit_slow: don't read destination pixel when you're going to discard it anyways
(cherry picked from commit 4cd0c13823
)
This commit is contained in:

committed by
Sam Lantinga

parent
321c2f8f24
commit
2d5c05a69c
@@ -106,6 +106,7 @@ void SDL_Blit_Slow(SDL_BlitInfo *info)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) {
|
||||
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
||||
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
|
||||
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
|
||||
@@ -116,6 +117,10 @@ void SDL_Blit_Slow(SDL_BlitInfo *info)
|
||||
dstpixel = *((Uint32 *) (dst));
|
||||
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
|
||||
}
|
||||
} else {
|
||||
/* don't care */
|
||||
dstR = dstG = dstB = dstA = 0;
|
||||
}
|
||||
|
||||
if (flags & SDL_COPY_MODULATE_COLOR) {
|
||||
srcR = (srcR * modulateR) / 255;
|
||||
|
Reference in New Issue
Block a user