21 #include "../SDL_internal.h" 34 c128.m128_u32[0] = color; \ 35 c128.m128_u32[1] = color; \ 36 c128.m128_u32[2] = color; \ 37 c128.m128_u32[3] = color; 41 DECLARE_ALIGNED(Uint32, cccc[4], 16); \ 46 c128 = *(__m128 *)cccc; 50 for (i = n / 64; i--;) { \ 51 _mm_stream_ps((float *)(p+0), c128); \ 52 _mm_stream_ps((float *)(p+16), c128); \ 53 _mm_stream_ps((float *)(p+32), c128); \ 54 _mm_stream_ps((float *)(p+48), c128); \ 60 #define DEFINE_SSE_FILLRECT(bpp, type) \ 62 SDL_FillRect##bpp##SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \ 74 int adjust = 16 - ((uintptr_t)p & 15); \ 79 *((type *)p) = (type)color; \ 86 int remainder = (n & 63); \ 88 while (remainder--) { \ 89 *((type *)p) = (type)color; \ 119 int remainder = (n & 63);
128 DEFINE_SSE_FILLRECT(2,
Uint16)
129 DEFINE_SSE_FILLRECT(4,
Uint32)
147 *p++ = (
Uint8) color;
150 *p++ = (
Uint8) color;
153 *p++ = (
Uint8) color;
162 *p++ = (
Uint8) color;
164 *p++ = (
Uint8) color;
166 *p++ = (
Uint8) color;
191 p[n - 1] = (
Uint16) color;
200 #if SDL_BYTEORDER == SDL_LIL_ENDIAN 204 #elif SDL_BYTEORDER == SDL_BIG_ENDIAN 249 return SDL_SetError(
"SDL_FillRect(): Unsupported surface format");
269 return SDL_SetError(
"SDL_FillRect(): You must lock the surface");
275 #
if SDL_ARM_NEON_BLITTERS
280 switch (dst->format->BytesPerPixel) {
282 FillRect8ARMNEONAsm(rect->
w, rect->
h, (
uint8_t *) pixels, dst->pitch >> 0, color);
285 FillRect16ARMNEONAsm(rect->
w, rect->
h, (
uint16_t *) pixels, dst->pitch >> 1, color);
288 FillRect32ARMNEONAsm(rect->
w, rect->
h, (
uint32_t *) pixels, dst->pitch >> 2, color);
296 #if SDL_ARM_SIMD_BLITTERS 301 switch (dst->format->BytesPerPixel) {
303 FillRect8ARMSIMDAsm(rect->
w, rect->
h, (
uint8_t *) pixels, dst->pitch >> 0, color);
306 FillRect16ARMSIMDAsm(rect->
w, rect->
h, (
uint16_t *) pixels, dst->pitch >> 1, color);
309 FillRect32ARMSIMDAsm(rect->
w, rect->
h, (
uint32_t *) pixels, dst->pitch >> 2, color);
321 color |= (color << 8);
322 color |= (color << 16);
325 SDL_FillRect1SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
335 color |= (color << 16);
338 SDL_FillRect2SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
357 SDL_FillRect4SSE(pixels, dst->
pitch, color, rect->
w, rect->
h);
378 return SDL_SetError(
"SDL_FillRects() passed NULL rects");
381 for (i = 0; i <
count; ++
i) {
#define SDL_UnlockSurface
GLuint GLuint GLsizei count
GLfloat GLfloat GLfloat GLfloat h
A collection of pixels used in software blitting.
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp local skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
#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)
SDL_bool SDL_HasARMSIMD(void)
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.