33 c128.m128_u32[0] = color; \
34 c128.m128_u32[1] = color; \
35 c128.m128_u32[2] = color; \
36 c128.m128_u32[3] = color;
40 DECLARE_ALIGNED(Uint32, cccc[4], 16); \
45 c128 = *(__m128 *)cccc;
49 for (i = n / 64; i--;) { \
50 _mm_stream_ps((float *)(p+0), c128); \
51 _mm_stream_ps((float *)(p+16), c128); \
52 _mm_stream_ps((float *)(p+32), c128); \
53 _mm_stream_ps((float *)(p+48), c128); \
59 #define DEFINE_SSE_FILLRECT(bpp, type) \
61 SDL_FillRect##bpp##SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \
73 int adjust = 16 - ((uintptr_t)p & 15); \
78 *((type *)p) = (type)color; \
85 int remainder = (n & 63); \
87 while (remainder--) { \
88 *((type *)p) = (type)color; \
129 DEFINE_SSE_FILLRECT(2,
Uint16)
130 DEFINE_SSE_FILLRECT(4,
Uint32)
139 __m64 c64 = _mm_set_pi32(color, color)
142 for (i = n / 64; i--;) { \
143 _mm_stream_pi((__m64 *)(p+0), c64); \
144 _mm_stream_pi((__m64 *)(p+8), c64); \
145 _mm_stream_pi((__m64 *)(p+16), c64); \
146 _mm_stream_pi((__m64 *)(p+24), c64); \
147 _mm_stream_pi((__m64 *)(p+32), c64); \
148 _mm_stream_pi((__m64 *)(p+40), c64); \
149 _mm_stream_pi((__m64 *)(p+48), c64); \
150 _mm_stream_pi((__m64 *)(p+56), c64); \
157 #define DEFINE_MMX_FILLRECT(bpp, type) \
159 SDL_FillRect##bpp##MMX(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \
171 int adjust = 8 - ((uintptr_t)p & 7); \
176 *((type *)p) = (type)color; \
183 int remainder = (n & 63); \
185 while (remainder--) { \
186 *((type *)p) = (type)color; \
197 SDL_FillRect1MMX(
Uint8 *pixels,
int pitch,
Uint32 color,
int w,
int h)
228 DEFINE_MMX_FILLRECT(2,
Uint16)
229 DEFINE_MMX_FILLRECT(4,
Uint32)
247 *p++ = (
Uint8) color;
250 *p++ = (
Uint8) color;
253 *p++ = (
Uint8) color;
262 *p++ = (
Uint8) color;
264 *p++ = (
Uint8) color;
266 *p++ = (
Uint8) color;
291 p[n - 1] = (
Uint16) color;
343 return SDL_SetError(
"SDL_FillRect(): Unsupported surface format");
359 return SDL_SetError(
"SDL_FillRect(): You must lock the surface");
368 color |= (color << 8);
369 color |= (color << 16);
372 SDL_FillRect1SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
378 SDL_FillRect1MMX(pixels, dst->
pitch, color, rect->
w, rect->
h);
388 color |= (color << 16);
391 SDL_FillRect2SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
397 SDL_FillRect2MMX(pixels, dst->
pitch, color, rect->
w, rect->
h);
416 SDL_FillRect4SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
422 SDL_FillRect4MMX(pixels, dst->
pitch, color, rect->
w, rect->
h);
443 return SDL_SetError(
"SDL_FillRects() passed NULL rects");
446 for (i = 0; i <
count; ++
i) {
GLfloat GLfloat GLfloat GLfloat h
A collection of pixels used in software blitting.
DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void)
DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void)
DECLSPEC int SDLCALL SDL_FillRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color)
static void SDL_FillRect3(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
uint32_t Uint32
An unsigned 32-bit integer type.
DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result)
Calculate the intersection of two rectangles.
DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len)
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
static void SDL_FillRect2(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
uint8_t Uint8
An unsigned 8-bit integer type.
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble b
SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t dwords)
GLint GLint GLint GLint GLint w
uint16_t Uint16
An unsigned 16-bit integer type.
static void SDL_FillRect4(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
static void SDL_FillRect1(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
DECLSPEC int SDLCALL SDL_FillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color)
A rectangle, with the origin at the upper left.
INT64 INT64 INT64 remainder