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) {
GLuint GLuint GLsizei count
GLfloat GLfloat GLfloat GLfloat h
A collection of pixels used in software blitting.
#define SDL_IntersectRect
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
Returns true if the rectangle has no area.
static void SDL_FillRect3(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
int SDL_FillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color)
SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
GLubyte GLubyte GLubyte GLubyte w
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
int SDL_FillRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color)
static void SDL_FillRect2(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
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)
EGLSurface EGLint * rects
A rectangle, with the origin at the upper left.