Gained 5 FPS in testsprite because Mac OS X memset is highly optimized
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402596
This commit is contained in:
parent
cbc3f4b4c4
commit
b88bb33e97
1 changed files with 4 additions and 1 deletions
|
@ -568,6 +568,7 @@ SDL_FillRect(SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color)
|
||||||
dstrect->x * dst->format->BytesPerPixel;
|
dstrect->x * dst->format->BytesPerPixel;
|
||||||
if (dst->format->palette || (color == 0)) {
|
if (dst->format->palette || (color == 0)) {
|
||||||
x = dstrect->w * dst->format->BytesPerPixel;
|
x = dstrect->w * dst->format->BytesPerPixel;
|
||||||
|
#ifndef __MACOSX__ /* memset() is optimized on Mac OS X */
|
||||||
if (!color && !((uintptr_t) row & 3) && !(x & 3)
|
if (!color && !((uintptr_t) row & 3) && !(x & 3)
|
||||||
&& !(dst->pitch & 3)) {
|
&& !(dst->pitch & 3)) {
|
||||||
int n = x >> 2;
|
int n = x >> 2;
|
||||||
|
@ -575,7 +576,9 @@ SDL_FillRect(SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color)
|
||||||
SDL_memset4(row, 0, n);
|
SDL_memset4(row, 0, n);
|
||||||
row += dst->pitch;
|
row += dst->pitch;
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
|
#endif /* !__MACOSX__ */
|
||||||
|
{
|
||||||
for (y = dstrect->h; y; y--) {
|
for (y = dstrect->h; y; y--) {
|
||||||
SDL_memset(row, color, x);
|
SDL_memset(row, color, x);
|
||||||
row += dst->pitch;
|
row += dst->pitch;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue