Gained 5 FPS in testsprite because Mac OS X memset is highly optimized
authorSam Lantinga <slouken@libsdl.org>
Sun, 12 Aug 2007 18:27:44 +0000
changeset 2234 cf8c3b0117b3
parent 2233 fb01ee9716bc
child 2235 55a8bebf9ba6
Gained 5 FPS in testsprite because Mac OS X memset is highly optimized
src/video/SDL_surface.c
--- a/src/video/SDL_surface.c	Sun Aug 12 16:53:58 2007 +0000
+++ b/src/video/SDL_surface.c	Sun Aug 12 18:27:44 2007 +0000
@@ -568,6 +568,7 @@
         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_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;