SDL  2.0
SDL_blit.h File Reference
#include "../SDL_internal.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_surface.h"
+ Include dependency graph for SDL_blit.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SDL_BlitInfo
 
struct  SDL_BlitFuncEntry
 
struct  SDL_BlitMap
 

Macros

#define SDL_COPY_MODULATE_COLOR   0x00000001
 
#define SDL_COPY_MODULATE_ALPHA   0x00000002
 
#define SDL_COPY_BLEND   0x00000010
 
#define SDL_COPY_ADD   0x00000020
 
#define SDL_COPY_MOD   0x00000040
 
#define SDL_COPY_MUL   0x00000080
 
#define SDL_COPY_COLORKEY   0x00000100
 
#define SDL_COPY_NEAREST   0x00000200
 
#define SDL_COPY_RLE_DESIRED   0x00001000
 
#define SDL_COPY_RLE_COLORKEY   0x00002000
 
#define SDL_COPY_RLE_ALPHAKEY   0x00004000
 
#define SDL_COPY_RLE_MASK   (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY)
 
#define SDL_CPU_ANY   0x00000000
 
#define SDL_CPU_MMX   0x00000001
 
#define SDL_CPU_3DNOW   0x00000002
 
#define SDL_CPU_SSE   0x00000004
 
#define SDL_CPU_SSE2   0x00000008
 
#define SDL_CPU_ALTIVEC_PREFETCH   0x00000010
 
#define SDL_CPU_ALTIVEC_NOPREFETCH   0x00000020
 
#define DECLARE_ALIGNED(t, v, a)   t v
 
#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b)
 
#define RGB_FROM_RGB565(Pixel, r, g, b)
 
#define RGB_FROM_RGB555(Pixel, r, g, b)
 
#define RGB_FROM_RGB888(Pixel, r, g, b)
 
#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel)
 
#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b)
 
#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)
 
#define RGB565_FROM_RGB(Pixel, r, g, b)
 
#define RGB555_FROM_RGB(Pixel, r, g, b)
 
#define RGB888_FROM_RGB(Pixel, r, g, b)
 
#define ARGB8888_FROM_RGBA(Pixel, r, g, b, a)
 
#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a)
 
#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a)
 
#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a)
 
#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a)
 
#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b)
 
#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a)
 
#define RGBA_FROM_8888(Pixel, fmt, r, g, b, a)
 
#define RGBA_FROM_RGBA8888(Pixel, r, g, b, a)
 
#define RGBA_FROM_ARGB8888(Pixel, r, g, b, a)
 
#define RGBA_FROM_ABGR8888(Pixel, r, g, b, a)
 
#define RGBA_FROM_BGRA8888(Pixel, r, g, b, a)
 
#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a)
 
#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)
 
#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)
 
#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)
 
#define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB)
 
#define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA)
 
#define USE_DUFFS_LOOP
 
#define DUFFS_LOOP8(pixel_copy_increment, width)
 
#define DUFFS_LOOP4(pixel_copy_increment, width)
 
#define DUFFS_LOOP(pixel_copy_increment, width)   DUFFS_LOOP8(pixel_copy_increment, width)
 
#define DUFFS_LOOP_124(pixel_copy_increment1, pixel_copy_increment2, pixel_copy_increment4, width)
 

Typedefs

typedef void(* SDL_BlitFunc) (SDL_BlitInfo *info)
 

Functions

int SDL_CalculateBlit (SDL_Surface *surface)
 
SDL_BlitFunc SDL_CalculateBlit0 (SDL_Surface *surface)
 
SDL_BlitFunc SDL_CalculateBlit1 (SDL_Surface *surface)
 
SDL_BlitFunc SDL_CalculateBlitN (SDL_Surface *surface)
 
SDL_BlitFunc SDL_CalculateBlitA (SDL_Surface *surface)
 

Variables

Uint8SDL_expand_byte [9]
 

Macro Definition Documentation

◆ ABGR8888_FROM_RGBA

#define ABGR8888_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = (a<<24)|(b<<16)|(g<<8)|r; \
}

Definition at line 247 of file SDL_blit.h.

◆ ALPHA_BLEND_RGB

#define ALPHA_BLEND_RGB (   sR,
  sG,
  sB,
  A,
  dR,
  dG,
  dB 
)
Value:
do { \
dR = (Uint8)((((int)(sR-dR)*(int)A)/255)+dR); \
dG = (Uint8)((((int)(sG-dG)*(int)A)/255)+dG); \
dB = (Uint8)((((int)(sB-dB)*(int)A)/255)+dB); \
} while(0)

Definition at line 447 of file SDL_blit.h.

◆ ALPHA_BLEND_RGBA

#define ALPHA_BLEND_RGBA (   sR,
  sG,
  sB,
  sA,
  dR,
  dG,
  dB,
  dA 
)
Value:
do { \
dR = (Uint8)((((int)(sR-dR)*(int)sA)/255)+dR); \
dG = (Uint8)((((int)(sG-dG)*(int)sA)/255)+dG); \
dB = (Uint8)((((int)(sB-dB)*(int)sA)/255)+dB); \
dA = (Uint8)((int)sA+dA-((int)sA*dA)/255); \
} while(0)

Definition at line 456 of file SDL_blit.h.

◆ ARGB2101010_FROM_RGBA

#define ARGB2101010_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = r ? ((r << 2) | 0x3) : 0; \
g = g ? ((g << 2) | 0x3) : 0; \
b = b ? ((b << 2) | 0x3) : 0; \
a = (a * 3) / 255; \
Pixel = (a<<30)|(r<<20)|(g<<10)|b; \
}

Definition at line 255 of file SDL_blit.h.

◆ ARGB8888_FROM_RGBA

#define ARGB8888_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = (a<<24)|(r<<16)|(g<<8)|b; \
}

Definition at line 239 of file SDL_blit.h.

◆ ASSEMBLE_RGB

#define ASSEMBLE_RGB (   buf,
  bpp,
  fmt,
  r,
  g,
  b 
)

Definition at line 263 of file SDL_blit.h.

◆ ASSEMBLE_RGBA

#define ASSEMBLE_RGBA (   buf,
  bpp,
  fmt,
  r,
  g,
  b,
  a 
)

Definition at line 404 of file SDL_blit.h.

◆ BGRA8888_FROM_RGBA

#define BGRA8888_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = (b<<24)|(g<<16)|(r<<8)|a; \
}

Definition at line 251 of file SDL_blit.h.

◆ DECLARE_ALIGNED

#define DECLARE_ALIGNED (   t,
  v,
  a 
)    t v

Definition at line 120 of file SDL_blit.h.

◆ DISEMBLE_RGB

#define DISEMBLE_RGB (   buf,
  bpp,
  fmt,
  Pixel,
  r,
  g,
  b 
)

Definition at line 179 of file SDL_blit.h.

◆ DISEMBLE_RGBA

#define DISEMBLE_RGBA (   buf,
  bpp,
  fmt,
  Pixel,
  r,
  g,
  b,
  a 
)

Definition at line 355 of file SDL_blit.h.

◆ DUFFS_LOOP

#define DUFFS_LOOP (   pixel_copy_increment,
  width 
)    DUFFS_LOOP8(pixel_copy_increment, width)

Definition at line 502 of file SDL_blit.h.

◆ DUFFS_LOOP4

#define DUFFS_LOOP4 (   pixel_copy_increment,
  width 
)
Value:
{ int n = (width+3)/4; \
switch (width & 3) { \
case 0: do { pixel_copy_increment; /* fallthrough */ \
case 3: pixel_copy_increment; /* fallthrough */ \
case 2: pixel_copy_increment; /* fallthrough */ \
case 1: pixel_copy_increment; /* fallthrough */ \
} while (--n > 0); \
} \
}

Definition at line 490 of file SDL_blit.h.

◆ DUFFS_LOOP8

#define DUFFS_LOOP8 (   pixel_copy_increment,
  width 
)
Value:
{ int n = (width+7)/8; \
switch (width & 7) { \
case 0: do { pixel_copy_increment; /* fallthrough */ \
case 7: pixel_copy_increment; /* fallthrough */ \
case 6: pixel_copy_increment; /* fallthrough */ \
case 5: pixel_copy_increment; /* fallthrough */ \
case 4: pixel_copy_increment; /* fallthrough */ \
case 3: pixel_copy_increment; /* fallthrough */ \
case 2: pixel_copy_increment; /* fallthrough */ \
case 1: pixel_copy_increment; /* fallthrough */ \
} while ( --n > 0 ); \
} \
}

Definition at line 474 of file SDL_blit.h.

◆ DUFFS_LOOP_124

#define DUFFS_LOOP_124 (   pixel_copy_increment1,
  pixel_copy_increment2,
  pixel_copy_increment4,
  width 
)
Value:
{ int n = width; \
if (n & 1) { \
pixel_copy_increment1; n -= 1; \
} \
if (n & 2) { \
pixel_copy_increment2; n -= 2; \
} \
if (n & 4) { \
pixel_copy_increment4; n -= 4; \
} \
if (n) { \
n /= 8; \
do { \
pixel_copy_increment4; \
pixel_copy_increment4; \
} while (--n > 0); \
} \
}

Definition at line 506 of file SDL_blit.h.

◆ PIXEL_FROM_RGB

#define PIXEL_FROM_RGB (   Pixel,
  fmt,
  r,
  g,
  b 
)
Value:
{ \
Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
((g>>fmt->Gloss)<<fmt->Gshift)| \
((b>>fmt->Bloss)<<fmt->Bshift)| \
fmt->Amask; \
}

Definition at line 220 of file SDL_blit.h.

◆ PIXEL_FROM_RGBA

#define PIXEL_FROM_RGBA (   Pixel,
  fmt,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
((g>>fmt->Gloss)<<fmt->Gshift)| \
((b>>fmt->Bloss)<<fmt->Bshift)| \
((a>>fmt->Aloss)<<fmt->Ashift); \
}

Definition at line 397 of file SDL_blit.h.

◆ RETRIEVE_RGB_PIXEL

#define RETRIEVE_RGB_PIXEL (   buf,
  bpp,
  Pixel 
)
Value:
do { \
switch (bpp) { \
case 1: \
Pixel = *((Uint8 *)(buf)); \
break; \
\
case 2: \
Pixel = *((Uint16 *)(buf)); \
break; \
\
case 3: { \
Uint8 *B = (Uint8 *)(buf); \
Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \
} else { \
Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \
} \
} \
break; \
\
case 4: \
Pixel = *((Uint32 *)(buf)); \
break; \
\
default: \
Pixel = 0; /* stop gcc complaints */ \
break; \
} \
} while (0)

Definition at line 148 of file SDL_blit.h.

◆ RGB555_FROM_RGB

#define RGB555_FROM_RGB (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \
}

Definition at line 231 of file SDL_blit.h.

◆ RGB565_FROM_RGB

#define RGB565_FROM_RGB (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \
}

Definition at line 227 of file SDL_blit.h.

◆ RGB888_FROM_RGB

#define RGB888_FROM_RGB (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
Pixel = (r<<16)|(g<<8)|b; \
}

Definition at line 235 of file SDL_blit.h.

◆ RGB_FROM_PIXEL

#define RGB_FROM_PIXEL (   Pixel,
  fmt,
  r,
  g,
  b 
)
Value:
{ \
r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \
g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \
b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \
}

Definition at line 124 of file SDL_blit.h.

◆ RGB_FROM_RGB555

#define RGB_FROM_RGB555 (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
r = SDL_expand_byte[3][((Pixel&0x7C00)>>10)]; \
g = SDL_expand_byte[3][((Pixel&0x03E0)>>5)]; \
b = SDL_expand_byte[3][(Pixel&0x001F)]; \
}

Definition at line 136 of file SDL_blit.h.

◆ RGB_FROM_RGB565

#define RGB_FROM_RGB565 (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
r = SDL_expand_byte[3][((Pixel&0xF800)>>11)]; \
g = SDL_expand_byte[2][((Pixel&0x07E0)>>5)]; \
b = SDL_expand_byte[3][(Pixel&0x001F)]; \
}

Definition at line 130 of file SDL_blit.h.

◆ RGB_FROM_RGB888

#define RGB_FROM_RGB888 (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
r = ((Pixel&0xFF0000)>>16); \
g = ((Pixel&0xFF00)>>8); \
b = (Pixel&0xFF); \
}

Definition at line 142 of file SDL_blit.h.

◆ RGBA8888_FROM_RGBA

#define RGBA8888_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = (r<<24)|(g<<16)|(b<<8)|a; \
}

Definition at line 243 of file SDL_blit.h.

◆ RGBA_FROM_8888

#define RGBA_FROM_8888 (   Pixel,
  fmt,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = (Pixel&fmt->Rmask)>>fmt->Rshift; \
g = (Pixel&fmt->Gmask)>>fmt->Gshift; \
b = (Pixel&fmt->Bmask)>>fmt->Bshift; \
a = (Pixel&fmt->Amask)>>fmt->Ashift; \
}

Definition at line 313 of file SDL_blit.h.

◆ RGBA_FROM_ABGR8888

#define RGBA_FROM_ABGR8888 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = (Pixel&0xFF); \
g = ((Pixel>>8)&0xFF); \
b = ((Pixel>>16)&0xFF); \
a = (Pixel>>24); \
}

Definition at line 334 of file SDL_blit.h.

◆ RGBA_FROM_ARGB2101010

#define RGBA_FROM_ARGB2101010 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = ((Pixel>>22)&0xFF); \
g = ((Pixel>>12)&0xFF); \
b = ((Pixel>>2)&0xFF); \
a = SDL_expand_byte[6][(Pixel>>30)]; \
}

Definition at line 348 of file SDL_blit.h.

◆ RGBA_FROM_ARGB8888

#define RGBA_FROM_ARGB8888 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = ((Pixel>>16)&0xFF); \
g = ((Pixel>>8)&0xFF); \
b = (Pixel&0xFF); \
a = (Pixel>>24); \
}

Definition at line 327 of file SDL_blit.h.

◆ RGBA_FROM_BGRA8888

#define RGBA_FROM_BGRA8888 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = ((Pixel>>8)&0xFF); \
g = ((Pixel>>16)&0xFF); \
b = (Pixel>>24); \
a = (Pixel&0xFF); \
}

Definition at line 341 of file SDL_blit.h.

◆ RGBA_FROM_PIXEL

#define RGBA_FROM_PIXEL (   Pixel,
  fmt,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \
g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \
b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \
a = SDL_expand_byte[fmt->Aloss][((Pixel&fmt->Amask)>>fmt->Ashift)]; \
}

Definition at line 306 of file SDL_blit.h.

◆ RGBA_FROM_RGBA8888

#define RGBA_FROM_RGBA8888 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = (Pixel>>24); \
g = ((Pixel>>16)&0xFF); \
b = ((Pixel>>8)&0xFF); \
a = (Pixel&0xFF); \
}

Definition at line 320 of file SDL_blit.h.

◆ SDL_COPY_ADD

#define SDL_COPY_ADD   0x00000020

Definition at line 38 of file SDL_blit.h.

◆ SDL_COPY_BLEND

#define SDL_COPY_BLEND   0x00000010

Definition at line 37 of file SDL_blit.h.

◆ SDL_COPY_COLORKEY

#define SDL_COPY_COLORKEY   0x00000100

Definition at line 41 of file SDL_blit.h.

◆ SDL_COPY_MOD

#define SDL_COPY_MOD   0x00000040

Definition at line 39 of file SDL_blit.h.

◆ SDL_COPY_MODULATE_ALPHA

#define SDL_COPY_MODULATE_ALPHA   0x00000002

Definition at line 36 of file SDL_blit.h.

◆ SDL_COPY_MODULATE_COLOR

#define SDL_COPY_MODULATE_COLOR   0x00000001

Definition at line 35 of file SDL_blit.h.

◆ SDL_COPY_MUL

#define SDL_COPY_MUL   0x00000080

Definition at line 40 of file SDL_blit.h.

◆ SDL_COPY_NEAREST

#define SDL_COPY_NEAREST   0x00000200

Definition at line 42 of file SDL_blit.h.

◆ SDL_COPY_RLE_ALPHAKEY

#define SDL_COPY_RLE_ALPHAKEY   0x00004000

Definition at line 45 of file SDL_blit.h.

◆ SDL_COPY_RLE_COLORKEY

#define SDL_COPY_RLE_COLORKEY   0x00002000

Definition at line 44 of file SDL_blit.h.

◆ SDL_COPY_RLE_DESIRED

#define SDL_COPY_RLE_DESIRED   0x00001000

Definition at line 43 of file SDL_blit.h.

◆ SDL_COPY_RLE_MASK

Definition at line 46 of file SDL_blit.h.

◆ SDL_CPU_3DNOW

#define SDL_CPU_3DNOW   0x00000002

Definition at line 51 of file SDL_blit.h.

◆ SDL_CPU_ALTIVEC_NOPREFETCH

#define SDL_CPU_ALTIVEC_NOPREFETCH   0x00000020

Definition at line 55 of file SDL_blit.h.

◆ SDL_CPU_ALTIVEC_PREFETCH

#define SDL_CPU_ALTIVEC_PREFETCH   0x00000010

Definition at line 54 of file SDL_blit.h.

◆ SDL_CPU_ANY

#define SDL_CPU_ANY   0x00000000

Definition at line 49 of file SDL_blit.h.

◆ SDL_CPU_MMX

#define SDL_CPU_MMX   0x00000001

Definition at line 50 of file SDL_blit.h.

◆ SDL_CPU_SSE

#define SDL_CPU_SSE   0x00000004

Definition at line 52 of file SDL_blit.h.

◆ SDL_CPU_SSE2

#define SDL_CPU_SSE2   0x00000008

Definition at line 53 of file SDL_blit.h.

◆ USE_DUFFS_LOOP

#define USE_DUFFS_LOOP

Definition at line 469 of file SDL_blit.h.

Typedef Documentation

◆ SDL_BlitFunc

typedef void(* SDL_BlitFunc) (SDL_BlitInfo *info)

Definition at line 74 of file SDL_blit.h.

Function Documentation

◆ SDL_CalculateBlit()

int SDL_CalculateBlit ( SDL_Surface surface)

Definition at line 196 of file SDL_blit.c.

197 {
198  SDL_BlitFunc blit = NULL;
199  SDL_BlitMap *map = surface->map;
200  SDL_Surface *dst = map->dst;
201 
202  /* We don't currently support blitting to < 8 bpp surfaces */
203  if (dst->format->BitsPerPixel < 8) {
205  return SDL_SetError("Blit combination not supported");
206  }
207 
208 #if SDL_HAVE_RLE
209  /* Clean everything out to start */
210  if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
212  }
213 #endif
214 
215  map->blit = SDL_SoftBlit;
216  map->info.src_fmt = surface->format;
217  map->info.src_pitch = surface->pitch;
218  map->info.dst_fmt = dst->format;
219  map->info.dst_pitch = dst->pitch;
220 
221 #if SDL_HAVE_RLE
222  /* See if we can do RLE acceleration */
223  if (map->info.flags & SDL_COPY_RLE_DESIRED) {
224  if (SDL_RLESurface(surface) == 0) {
225  return 0;
226  }
227  }
228 #endif
229 
230  /* Choose a standard blit function */
231  if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) {
232  blit = SDL_BlitCopy;
233  } else if (surface->format->Rloss > 8 || dst->format->Rloss > 8) {
234  /* Greater than 8 bits per channel not supported yet */
236  return SDL_SetError("Blit combination not supported");
237  }
238 #if SDL_HAVE_BLIT_0
239  else if (surface->format->BitsPerPixel < 8 &&
240  SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) {
241  blit = SDL_CalculateBlit0(surface);
242  }
243 #endif
244 #if SDL_HAVE_BLIT_1
245  else if (surface->format->BytesPerPixel == 1 &&
246  SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) {
247  blit = SDL_CalculateBlit1(surface);
248  }
249 #endif
250 #if SDL_HAVE_BLIT_A
251  else if (map->info.flags & SDL_COPY_BLEND) {
252  blit = SDL_CalculateBlitA(surface);
253  }
254 #endif
255 #if SDL_HAVE_BLIT_N
256  else {
257  blit = SDL_CalculateBlitN(surface);
258  }
259 #endif
260 #if SDL_HAVE_BLIT_AUTO
261  if (blit == NULL) {
262  Uint32 src_format = surface->format->format;
263  Uint32 dst_format = dst->format->format;
264 
265  blit =
266  SDL_ChooseBlitFunc(src_format, dst_format, map->info.flags,
268  }
269 #endif
270 
271 #ifndef TEST_SLOW_BLIT
272  if (blit == NULL)
273 #endif
274  {
275  Uint32 src_format = surface->format->format;
276  Uint32 dst_format = dst->format->format;
277 
278  if (!SDL_ISPIXELFORMAT_INDEXED(src_format) &&
279  !SDL_ISPIXELFORMAT_FOURCC(src_format) &&
280  !SDL_ISPIXELFORMAT_INDEXED(dst_format) &&
281  !SDL_ISPIXELFORMAT_FOURCC(dst_format)) {
282  blit = SDL_Blit_Slow;
283  }
284  }
285  map->data = blit;
286 
287  /* Make sure we have a blit function */
288  if (blit == NULL) {
290  return SDL_SetError("Blit combination not supported");
291  }
292 
293  return 0;
294 }

References map, NULL, SDL_Blit_Slow(), SDL_BlitCopy(), SDL_CalculateBlit0(), SDL_CalculateBlit1(), SDL_CalculateBlitA(), SDL_CalculateBlitN(), SDL_ChooseBlitFunc(), SDL_COPY_BLEND, SDL_COPY_RLE_DESIRED, SDL_GeneratedBlitFuncTable, SDL_InvalidateMap(), SDL_ISPIXELFORMAT_FOURCC, SDL_ISPIXELFORMAT_INDEXED, SDL_RLEACCEL, SDL_RLESurface(), SDL_SetError, SDL_SoftBlit(), and SDL_UnRLESurface().

Referenced by SDL_MapSurface().

◆ SDL_CalculateBlit0()

SDL_BlitFunc SDL_CalculateBlit0 ( SDL_Surface surface)

Definition at line 456 of file SDL_blit_0.c.

457 {
458  int which;
459 
460  if (surface->format->BitsPerPixel != 1) {
461  /* We don't support sub 8-bit packed pixel modes */
462  return (SDL_BlitFunc) NULL;
463  }
464  if (surface->map->dst->format->BitsPerPixel < 8) {
465  which = 0;
466  } else {
467  which = surface->map->dst->format->BytesPerPixel;
468  }
469  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
470  case 0:
471  return bitmap_blit[which];
472 
473  case SDL_COPY_COLORKEY:
474  return colorkey_blit[which];
475 
477  return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL;
478 
480  return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL;
481  }
482  return (SDL_BlitFunc) NULL;
483 }

References bitmap_blit, BlitBtoNAlpha(), BlitBtoNAlphaKey(), colorkey_blit, NULL, SDL_COPY_BLEND, SDL_COPY_COLORKEY, SDL_COPY_MODULATE_ALPHA, and SDL_COPY_RLE_MASK.

Referenced by SDL_CalculateBlit().

◆ SDL_CalculateBlit1()

SDL_BlitFunc SDL_CalculateBlit1 ( SDL_Surface surface)

Definition at line 524 of file SDL_blit_1.c.

525 {
526  int which;
527  SDL_PixelFormat *dstfmt;
528 
529  dstfmt = surface->map->dst->format;
530  if (dstfmt->BitsPerPixel < 8) {
531  which = 0;
532  } else {
533  which = dstfmt->BytesPerPixel;
534  }
535  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
536  case 0:
537  return one_blit[which];
538 
539  case SDL_COPY_COLORKEY:
540  return one_blitkey[which];
541 
543  /* Supporting 8bpp->8bpp alpha is doable but requires lots of
544  tables which consume space and takes time to precompute,
545  so is better left to the user */
546  return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc) NULL;
547 
549  return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc) NULL;
550  }
551  return (SDL_BlitFunc) NULL;
552 }

References SDL_PixelFormat::BitsPerPixel, Blit1toNAlpha(), Blit1toNAlphaKey(), SDL_PixelFormat::BytesPerPixel, SDL_PixelFormat::format, NULL, one_blit, one_blitkey, SDL_COPY_BLEND, SDL_COPY_COLORKEY, SDL_COPY_MODULATE_ALPHA, and SDL_COPY_RLE_MASK.

Referenced by SDL_CalculateBlit().

◆ SDL_CalculateBlitA()

SDL_BlitFunc SDL_CalculateBlitA ( SDL_Surface surface)

Definition at line 1335 of file SDL_blit_A.c.

1336 {
1338  SDL_PixelFormat *df = surface->map->dst->format;
1339 
1340  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
1341  case SDL_COPY_BLEND:
1342  /* Per-pixel alpha blits */
1343  switch (df->BytesPerPixel) {
1344  case 1:
1345  if (df->palette != NULL) {
1346  return BlitNto1PixelAlpha;
1347  } else {
1348  /* RGB332 has no palette ! */
1349  return BlitNtoNPixelAlpha;
1350  }
1351 
1352  case 2:
1353 #if SDL_ARM_NEON_BLITTERS || SDL_ARM_SIMD_BLITTERS
1354  if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
1355  && sf->Gmask == 0xff00 && df->Gmask == 0x7e0
1356  && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
1357  || (sf->Bmask == 0xff && df->Bmask == 0x1f)))
1358  {
1359 #if SDL_ARM_NEON_BLITTERS
1360  if (SDL_HasNEON())
1361  return BlitARGBto565PixelAlphaARMNEON;
1362 #endif
1363 #if SDL_ARM_SIMD_BLITTERS
1364  if (SDL_HasARMSIMD())
1365  return BlitARGBto565PixelAlphaARMSIMD;
1366 #endif
1367  }
1368 #endif
1369  if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
1370  && sf->Gmask == 0xff00
1371  && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
1372  || (sf->Bmask == 0xff && df->Bmask == 0x1f))) {
1373  if (df->Gmask == 0x7e0)
1374  return BlitARGBto565PixelAlpha;
1375  else if (df->Gmask == 0x3e0)
1376  return BlitARGBto555PixelAlpha;
1377  }
1378  return BlitNtoNPixelAlpha;
1379 
1380  case 4:
1381  if (sf->Rmask == df->Rmask
1382  && sf->Gmask == df->Gmask
1383  && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) {
1384 #if defined(__MMX__) || defined(__3dNOW__)
1385  if (sf->Rshift % 8 == 0
1386  && sf->Gshift % 8 == 0
1387  && sf->Bshift % 8 == 0
1388  && sf->Ashift % 8 == 0 && sf->Aloss == 0) {
1389 #ifdef __3dNOW__
1390  if (SDL_Has3DNow())
1391  return BlitRGBtoRGBPixelAlphaMMX3DNOW;
1392 #endif
1393 #ifdef __MMX__
1394  if (SDL_HasMMX())
1395  return BlitRGBtoRGBPixelAlphaMMX;
1396 #endif
1397  }
1398 #endif /* __MMX__ || __3dNOW__ */
1399  if (sf->Amask == 0xff000000) {
1400 #if SDL_ARM_NEON_BLITTERS
1401  if (SDL_HasNEON())
1402  return BlitRGBtoRGBPixelAlphaARMNEON;
1403 #endif
1404 #if SDL_ARM_SIMD_BLITTERS
1405  if (SDL_HasARMSIMD())
1406  return BlitRGBtoRGBPixelAlphaARMSIMD;
1407 #endif
1408  return BlitRGBtoRGBPixelAlpha;
1409  }
1410  }
1411  return BlitNtoNPixelAlpha;
1412 
1413  case 3:
1414  default:
1415  break;
1416  }
1417  return BlitNtoNPixelAlpha;
1418 
1420  if (sf->Amask == 0) {
1421  /* Per-surface alpha blits */
1422  switch (df->BytesPerPixel) {
1423  case 1:
1424  if (df->palette != NULL) {
1425  return BlitNto1SurfaceAlpha;
1426  } else {
1427  /* RGB332 has no palette ! */
1428  return BlitNtoNSurfaceAlpha;
1429  }
1430 
1431  case 2:
1432  if (surface->map->identity) {
1433  if (df->Gmask == 0x7e0) {
1434 #ifdef __MMX__
1435  if (SDL_HasMMX())
1436  return Blit565to565SurfaceAlphaMMX;
1437  else
1438 #endif
1439  return Blit565to565SurfaceAlpha;
1440  } else if (df->Gmask == 0x3e0) {
1441 #ifdef __MMX__
1442  if (SDL_HasMMX())
1443  return Blit555to555SurfaceAlphaMMX;
1444  else
1445 #endif
1446  return Blit555to555SurfaceAlpha;
1447  }
1448  }
1449  return BlitNtoNSurfaceAlpha;
1450 
1451  case 4:
1452  if (sf->Rmask == df->Rmask
1453  && sf->Gmask == df->Gmask
1454  && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) {
1455 #ifdef __MMX__
1456  if (sf->Rshift % 8 == 0
1457  && sf->Gshift % 8 == 0
1458  && sf->Bshift % 8 == 0 && SDL_HasMMX())
1459  return BlitRGBtoRGBSurfaceAlphaMMX;
1460 #endif
1461  if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) {
1462  return BlitRGBtoRGBSurfaceAlpha;
1463  }
1464  }
1465  return BlitNtoNSurfaceAlpha;
1466 
1467  case 3:
1468  default:
1469  return BlitNtoNSurfaceAlpha;
1470  }
1471  }
1472  break;
1473 
1475  if (sf->Amask == 0) {
1476  if (df->BytesPerPixel == 1) {
1477 
1478  if (df->palette != NULL) {
1479  return BlitNto1SurfaceAlphaKey;
1480  } else {
1481  /* RGB332 has no palette ! */
1482  return BlitNtoNSurfaceAlphaKey;
1483  }
1484  } else {
1485  return BlitNtoNSurfaceAlphaKey;
1486  }
1487  }
1488  break;
1489  }
1490 
1491  return NULL;
1492 }

References SDL_PixelFormat::Aloss, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, Blit555to555SurfaceAlpha(), Blit565to565SurfaceAlpha(), BlitARGBto555PixelAlpha(), BlitARGBto565PixelAlpha(), BlitNto1PixelAlpha(), BlitNto1SurfaceAlpha(), BlitNto1SurfaceAlphaKey(), BlitNtoNPixelAlpha(), BlitNtoNSurfaceAlpha(), BlitNtoNSurfaceAlphaKey(), BlitRGBtoRGBPixelAlpha(), BlitRGBtoRGBSurfaceAlpha(), SDL_PixelFormat::Bmask, SDL_PixelFormat::Bshift, SDL_PixelFormat::BytesPerPixel, SDL_PixelFormat::format, SDL_PixelFormat::Gmask, SDL_PixelFormat::Gshift, NULL, SDL_PixelFormat::palette, SDL_PixelFormat::Rmask, SDL_PixelFormat::Rshift, SDL_COPY_BLEND, SDL_COPY_COLORKEY, SDL_COPY_MODULATE_ALPHA, SDL_COPY_RLE_MASK, SDL_Has3DNow, SDL_HasARMSIMD, SDL_HasMMX, and SDL_HasNEON.

Referenced by SDL_CalculateBlit().

◆ SDL_CalculateBlitN()

SDL_BlitFunc SDL_CalculateBlitN ( SDL_Surface surface)

Definition at line 3360 of file SDL_blit_N.c.

3361 {
3362  SDL_PixelFormat *srcfmt;
3363  SDL_PixelFormat *dstfmt;
3364  const struct blit_table *table;
3365  int which;
3366  SDL_BlitFunc blitfun;
3367 
3368  /* Set up data for choosing the blit */
3369  srcfmt = surface->format;
3370  dstfmt = surface->map->dst->format;
3371 
3372  /* We don't support destinations less than 8-bits */
3373  if (dstfmt->BitsPerPixel < 8) {
3374  return (NULL);
3375  }
3376 
3377  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
3378  case 0:
3379  blitfun = NULL;
3380  if (dstfmt->BitsPerPixel == 8) {
3381  if ((srcfmt->BytesPerPixel == 4) &&
3382  (srcfmt->Rmask == 0x00FF0000) &&
3383  (srcfmt->Gmask == 0x0000FF00) &&
3384  (srcfmt->Bmask == 0x000000FF)) {
3385  blitfun = Blit_RGB888_index8;
3386  } else if ((srcfmt->BytesPerPixel == 4) &&
3387  (srcfmt->Rmask == 0x3FF00000) &&
3388  (srcfmt->Gmask == 0x000FFC00) &&
3389  (srcfmt->Bmask == 0x000003FF)) {
3390  blitfun = Blit_RGB101010_index8;
3391  } else {
3392  blitfun = BlitNto1;
3393  }
3394  } else {
3395  /* Now the meat, choose the blitter we want */
3396  Uint32 a_need = NO_ALPHA;
3397  if (dstfmt->Amask)
3398  a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
3399  table = normal_blit[srcfmt->BytesPerPixel - 1];
3400  for (which = 0; table[which].dstbpp; ++which) {
3401  if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
3402  MASKOK(srcfmt->Gmask, table[which].srcG) &&
3403  MASKOK(srcfmt->Bmask, table[which].srcB) &&
3404  MASKOK(dstfmt->Rmask, table[which].dstR) &&
3405  MASKOK(dstfmt->Gmask, table[which].dstG) &&
3406  MASKOK(dstfmt->Bmask, table[which].dstB) &&
3407  dstfmt->BytesPerPixel == table[which].dstbpp &&
3408  (a_need & table[which].alpha) == a_need &&
3409  ((table[which].blit_features & GetBlitFeatures()) ==
3410  table[which].blit_features))
3411  break;
3412  }
3413  blitfun = table[which].blitfunc;
3414 
3415  if (blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */
3416  if (srcfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
3417  blitfun = Blit2101010toN;
3418  } else if (dstfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
3419  blitfun = BlitNto2101010;
3420  } else if (srcfmt->BytesPerPixel == 4 &&
3421  dstfmt->BytesPerPixel == 4 &&
3422  srcfmt->Rmask == dstfmt->Rmask &&
3423  srcfmt->Gmask == dstfmt->Gmask &&
3424  srcfmt->Bmask == dstfmt->Bmask) {
3425  if (a_need == COPY_ALPHA) {
3426  if (srcfmt->Amask == dstfmt->Amask) {
3427  /* Fastpath C fallback: 32bit RGBA<->RGBA blit with matching RGBA */
3428  blitfun = Blit4to4CopyAlpha;
3429  } else {
3430  blitfun = BlitNtoNCopyAlpha;
3431  }
3432  } else {
3433  /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
3434  blitfun = Blit4to4MaskAlpha;
3435  }
3436  } else if (a_need == COPY_ALPHA) {
3437  blitfun = BlitNtoNCopyAlpha;
3438  }
3439  }
3440  }
3441  return (blitfun);
3442 
3443  case SDL_COPY_COLORKEY:
3444  /* colorkey blit: Here we don't have too many options, mostly
3445  because RLE is the preferred fast way to deal with this.
3446  If a particular case turns out to be useful we'll add it. */
3447 
3448  if (srcfmt->BytesPerPixel == 2 && surface->map->identity)
3449  return Blit2to2Key;
3450  else if (dstfmt->BytesPerPixel == 1)
3451  return BlitNto1Key;
3452  else {
3453 #if SDL_ALTIVEC_BLITTERS
3454  if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4)
3455  && SDL_HasAltiVec()) {
3456  return Blit32to32KeyAltivec;
3457  } else
3458 #endif
3459  if (srcfmt->Amask && dstfmt->Amask) {
3460  return BlitNtoNKeyCopyAlpha;
3461  } else {
3462  return BlitNtoNKey;
3463  }
3464  }
3465  }
3466 
3467  return NULL;
3468 }

References SDL_PixelFormat::Amask, SDL_PixelFormat::BitsPerPixel, Blit2101010toN(), Blit2to2Key(), Blit4to4CopyAlpha(), Blit4to4MaskAlpha(), Blit_RGB101010_index8(), Blit_RGB888_index8(), blit_table::blitfunc, BlitNto1(), BlitNto1Key(), BlitNto2101010(), BlitNtoN(), BlitNtoNCopyAlpha(), BlitNtoNKey(), BlitNtoNKeyCopyAlpha(), SDL_PixelFormat::Bmask, SDL_PixelFormat::BytesPerPixel, COPY_ALPHA, SDL_PixelFormat::format, GetBlitFeatures, SDL_PixelFormat::Gmask, MASKOK, NO_ALPHA, normal_blit, NULL, SDL_PixelFormat::Rmask, SDL_COPY_COLORKEY, SDL_COPY_RLE_MASK, SDL_HasAltiVec, SDL_PIXELFORMAT_ARGB2101010, and SET_ALPHA.

Referenced by SDL_CalculateBlit().

Variable Documentation

◆ SDL_expand_byte

Uint8* SDL_expand_byte[9]

Definition at line 71 of file SDL_pixels.c.

Referenced by SDL_GetRGB(), and SDL_GetRGBA().

Blit_RGB101010_index8
static void Blit_RGB101010_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1099
SDL_PixelFormat::Rshift
Uint8 Rshift
Definition: SDL_pixels.h:333
SDL_PixelFormat::Ashift
Uint8 Ashift
Definition: SDL_pixels.h:336
BlitNto1SurfaceAlphaKey
static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:125
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179
SDL_ChooseBlitFunc
static SDL_BlitFunc SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, SDL_BlitFuncEntry *entries)
Definition: SDL_blit.c:130
COPY_ALPHA
#define COPY_ALPHA
Definition: SDL_blit_N.c:3226
SDL_PixelFormat::BitsPerPixel
Uint8 BitsPerPixel
Definition: SDL_pixels.h:322
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:323
SDL_HasAltiVec
#define SDL_HasAltiVec
Definition: SDL_dynapi_overrides.h:104
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:191
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:71
SDL_BlitMap
Definition: SDL_blit.h:88
SDL_Has3DNow
#define SDL_Has3DNow
Definition: SDL_dynapi_overrides.h:106
BlitARGBto555PixelAlpha
static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1166
SDL_RLEACCEL
#define SDL_RLEACCEL
Definition: SDL_surface.h:54
NULL
#define NULL
Definition: begin_code.h:167
surface
EGLSurface surface
Definition: eglext.h:248
SDL_PixelFormat::format
Uint32 format
Definition: SDL_pixels.h:320
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
normal_blit
static const struct blit_table *const normal_blit[]
Definition: SDL_blit_N.c:3352
BlitNto1SurfaceAlpha
static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:32
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1112
SDL_UnRLESurface
void SDL_UnRLESurface(SDL_Surface *surface, int recode)
Definition: SDL_RLEaccel.c:1547
MASKOK
#define MASKOK(x, y)
Definition: SDL_blit_N.c:3357
Blit_RGB888_index8
static void Blit_RGB888_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:989
BlitNtoNKey
static void BlitNtoNKey(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2607
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
BlitBtoNAlpha
static void BlitBtoNAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_0.c:356
SDL_COPY_COLORKEY
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:40
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_Blit_Slow
void SDL_Blit_Slow(SDL_BlitInfo *info)
Definition: SDL_blit_slow.c:31
SDL_ISPIXELFORMAT_INDEXED
#define SDL_ISPIXELFORMAT_INDEXED(format)
Definition: SDL_pixels.h:134
SDL_PixelFormat::Rmask
Uint32 Rmask
Definition: SDL_pixels.h:325
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1112
map
const GLubyte GLuint GLuint GLuint GLuint alpha GLboolean GLboolean GLboolean GLboolean alpha GLint GLint GLsizei GLsizei GLenum type GLenum GLint GLenum GLint GLint GLsizei GLsizei GLint border GLenum GLint GLint GLint GLint GLint GLsizei GLsizei height GLsizei GLsizei GLenum GLenum const GLvoid *pixels GLenum GLint GLint GLint GLint j2 GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLfloat *params GLenum GLint GLenum GLenum GLvoid *pixels GLenum GLint GLenum GLint *params GLenum GLenum GLint *params GLenum GLsizei const GLvoid *pointer GLenum GLenum const GLint *params GLenum GLfloat GLfloat GLint GLint const GLfloat *points GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat *points GLint GLfloat GLfloat GLint GLfloat GLfloat v2 GLenum GLenum const GLint *params GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum map
Definition: SDL_glfuncs.h:291
Blit2101010toN
static void Blit2101010toN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2983
Blit4to4CopyAlpha
static void Blit4to4CopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2223
SDL_COPY_RLE_MASK
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:45
n
GLdouble n
Definition: SDL_opengl_glext.h:1955
one_blitkey
static const SDL_BlitFunc one_blitkey[]
Definition: SDL_blit_1.c:519
SDL_COPY_RLE_DESIRED
#define SDL_COPY_RLE_DESIRED
Definition: SDL_blit.h:42
blit_features
blit_features
Definition: SDL_blit_N.c:43
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1740
SDL_LIL_ENDIAN
#define SDL_LIL_ENDIAN
Definition: SDL_endian.h:37
buf
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: SDL_opengl_glext.h:2483
BlitARGBto565PixelAlpha
static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1120
BlitNtoN
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2330
NO_ALPHA
#define NO_ALPHA
Definition: SDL_blit_N.c:3224
Blit555to555SurfaceAlpha
static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1081
Blit1toNAlphaKey
static void Blit1toNAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_1.c:473
bitmap_blit
static const SDL_BlitFunc bitmap_blit[]
Definition: SDL_blit_0.c:447
BlitNtoNPixelAlpha
static void BlitNtoNPixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1293
BlitNtoNSurfaceAlphaKey
static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1252
BlitBtoNAlphaKey
static void BlitBtoNAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_0.c:401
Blit1toNAlpha
static void Blit1toNAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_1.c:433
SDL_COPY_BLEND
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_RLESurface
int SDL_RLESurface(SDL_Surface *surface)
Definition: SDL_RLEaccel.c:1407
SDL_PIXELFORMAT_ARGB2101010
@ SDL_PIXELFORMAT_ARGB2101010
Definition: SDL_pixels.h:263
Blit4to4MaskAlpha
static void Blit4to4MaskAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2173
SDL_PixelFormat::palette
SDL_Palette * palette
Definition: SDL_pixels.h:321
SDL_CalculateBlitA
SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface)
Definition: SDL_blit_A.c:1335
SET_ALPHA
#define SET_ALPHA
Definition: SDL_blit_N.c:3225
colorkey_blit
static const SDL_BlitFunc colorkey_blit[]
Definition: SDL_blit_0.c:451
blit_table::blitfunc
SDL_BlitFunc blitfunc
Definition: SDL_blit_N.c:3233
BlitNto1PixelAlpha
static void BlitNto1PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:79
SDL_PixelFormat::Amask
Uint32 Amask
Definition: SDL_pixels.h:328
SDL_GeneratedBlitFuncTable
SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]
Definition: SDL_blit_auto.c:7547
SDL_HasNEON
#define SDL_HasNEON
Definition: SDL_dynapi_overrides.h:618
SDL_PixelFormat
Definition: SDL_pixels.h:319
SDL_PixelFormat::Gmask
Uint32 Gmask
Definition: SDL_pixels.h:326
Blit565to565SurfaceAlpha
static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1042
BlitNtoNSurfaceAlpha
static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1213
one_blit
static const SDL_BlitFunc one_blit[]
Definition: SDL_blit_1.c:515
BlitNto1Key
static void BlitNto1Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2507
SDL_COPY_MODULATE_ALPHA
#define SDL_COPY_MODULATE_ALPHA
Definition: SDL_blit.h:35
GetBlitFeatures
#define GetBlitFeatures()
Definition: SDL_blit_N.c:938
bpp
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
Definition: pixman-arm-neon-asm.h:146
SDL_HasMMX
#define SDL_HasMMX
Definition: SDL_dynapi_overrides.h:105
SDL_PixelFormat::Bmask
Uint32 Bmask
Definition: SDL_pixels.h:327
BlitNtoNCopyAlpha
static void BlitNtoNCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2449
SDL_expand_byte
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71
SDL_ISPIXELFORMAT_FOURCC
#define SDL_ISPIXELFORMAT_FOURCC(format)
Definition: SDL_pixels.h:167
SDL_CalculateBlitN
SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface)
Definition: SDL_blit_N.c:3360
BlitNto2101010
static void BlitNto2101010(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:3015
BlitNtoNKeyCopyAlpha
static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2879
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
SDL_InvalidateMap
void SDL_InvalidateMap(SDL_BlitMap *map)
Definition: SDL_pixels.c:979
SDL_PixelFormat::Bshift
Uint8 Bshift
Definition: SDL_pixels.h:335
SDL_PixelFormat::Aloss
Uint8 Aloss
Definition: SDL_pixels.h:332
SDL_CalculateBlit0
SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface)
Definition: SDL_blit_0.c:456
SDL_HasARMSIMD
#define SDL_HasARMSIMD
Definition: SDL_dynapi_overrides.h:730
SDL_CalculateBlit1
SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface)
Definition: SDL_blit_1.c:524
SDL_PixelFormat::Gshift
Uint8 Gshift
Definition: SDL_pixels.h:334
BlitRGBtoRGBPixelAlpha
static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:527
SDL_SoftBlit
static int SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
Definition: SDL_blit.c:34
SDL_BYTEORDER
#define SDL_BYTEORDER
Definition: SDL_config_pandora.h:37
blit_table
Definition: SDL_blit_N.c:3228
Blit2to2Key
static void Blit2to2Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2573
table
GLenum GLsizei GLenum GLenum const void * table
Definition: SDL_opengl_glext.h:3121
BlitRGBtoRGBSurfaceAlpha
static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:485
BlitNto1
static void BlitNto1(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2078
SDL_BlitFunc
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:74
SDL_BlitCopy
void SDL_BlitCopy(SDL_BlitInfo *info)
Definition: SDL_blit_copy.c:91