From 3eff1b597c6b79cc2d6ede65b18f8ab5e22ed8cb Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 12 Aug 2007 18:27:44 +0000 Subject: [PATCH] Gained 5 FPS in testsprite because Mac OS X memset is highly optimized --- src/video/SDL_surface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index a077974df..4585f2366 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -568,6 +568,7 @@ SDL_FillRect(SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color) dstrect->x * dst->format->BytesPerPixel; if (dst->format->palette || (color == 0)) { x = dstrect->w * dst->format->BytesPerPixel; +#ifndef __MACOSX__ /* memset() is optimized on Mac OS X */ if (!color && !((uintptr_t) row & 3) && !(x & 3) && !(dst->pitch & 3)) { int n = x >> 2; @@ -575,7 +576,9 @@ SDL_FillRect(SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color) SDL_memset4(row, 0, n); row += dst->pitch; } - } else { + } else +#endif /* !__MACOSX__ */ + { for (y = dstrect->h; y; y--) { SDL_memset(row, color, x); row += dst->pitch;