From 78991bdb1335083f5fce3fb77e82c82f08f08b5b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 20 Jul 2024 21:17:15 -0700 Subject: [PATCH] Revert "SDL_BlitSurfaceUnchecked() should invalidate the map when switching from scaled to unscaled blits" This reverts commit 1f3b2fc8b3cf2443387d953a6271642ade1cdeda. SDL_BlitSurface() also handles scaling, so we shouldn't clear the scaling flag inside of it. --- src/video/SDL_surface.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index e2626ac11f..4e6996ecf3 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -855,12 +855,6 @@ int SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect) int SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) { - /* Switch back to a fast blit if we were previously stretching */ - if (src->internal->map.info.flags & SDL_COPY_NEAREST) { - src->internal->map.info.flags &= ~SDL_COPY_NEAREST; - SDL_InvalidateMap(&src->internal->map); - } - /* Check to make sure the blit mapping is valid */ if ((src->internal->map.dst != dst) || (dst->internal->palette && @@ -948,6 +942,12 @@ int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, return 0; } + /* Switch back to a fast blit if we were previously stretching */ + if (src->internal->map.info.flags & SDL_COPY_NEAREST) { + src->internal->map.info.flags &= ~SDL_COPY_NEAREST; + SDL_InvalidateMap(&src->internal->map); + } + return SDL_BlitSurfaceUnchecked(src, &r_src, dst, &r_dst); }