21 #include "../SDL_internal.h"
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; \
118 int remainder = (n & 63);
127 DEFINE_SSE_FILLRECT(2,
Uint16)
128 DEFINE_SSE_FILLRECT(4,
Uint32)
146 *p++ = (
Uint8) color;
149 *p++ = (
Uint8) color;
152 *p++ = (
Uint8) color;
161 *p++ = (
Uint8) color;
163 *p++ = (
Uint8) color;
165 *p++ = (
Uint8) color;
190 p[n - 1] = (
Uint16) color;
199 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
203 #elif SDL_BYTEORDER == SDL_BIG_ENDIAN
248 return SDL_SetError(
"SDL_FillRect(): Unsupported surface format");
268 return SDL_SetError(
"SDL_FillRect(): You must lock the surface");
277 color |= (color << 8);
278 color |= (color << 16);
281 SDL_FillRect1SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
291 color |= (color << 16);
294 SDL_FillRect2SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
313 SDL_FillRect4SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
334 return SDL_SetError(
"SDL_FillRects() passed NULL rects");
337 for (i = 0; i <
count; ++
i) {