mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-09 13:05:38 +00:00
blit_slow: don't read destination pixel when you're going to discard it anyways
(cherry picked from commit 4cd0c13823551cce279c9ff3d284c41c28deb3d8)
This commit is contained in:
parent
321c2f8f24
commit
2d5c05a69c
|
@ -106,15 +106,20 @@ void SDL_Blit_Slow(SDL_BlitInfo *info)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) {
|
||||||
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
|
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
||||||
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
|
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
|
||||||
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
|
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
|
||||||
dstA = 0xFF;
|
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
|
||||||
|
dstA = 0xFF;
|
||||||
|
} else {
|
||||||
|
/* SDL_PIXELFORMAT_ARGB2101010 */
|
||||||
|
dstpixel = *((Uint32 *) (dst));
|
||||||
|
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* SDL_PIXELFORMAT_ARGB2101010 */
|
/* don't care */
|
||||||
dstpixel = *((Uint32 *)(dst));
|
dstR = dstG = dstB = dstA = 0;
|
||||||
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & SDL_COPY_MODULATE_COLOR) {
|
if (flags & SDL_COPY_MODULATE_COLOR) {
|
||||||
|
|
Loading…
Reference in a new issue