SDL_blit_copy.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

void | SDL_BlitCopy (SDL_BlitInfo *info)

## Function Documentation

void SDL_BlitCopy | ( | SDL_BlitInfo * | info | ) |

Definition at line 91 of file SDL_blit_copy.c.

References SDL_PixelFormat::BytesPerPixel, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_pitch, SDL_BlitInfo::dst_w, SDL_HasMMX, SDL_HasSSE, SDL_memcpy, SDL_memmove, SDL_BlitInfo::src, and SDL_BlitInfo::src_pitch.

Referenced by SDL_CalculateBlit().

{
SDL_bool overlap;
Uint8 *src, *dst;
int w, h;
int srcskip, dstskip;
w = info->dst_w * info->dst_fmt->BytesPerPixel;
h = info->dst_h;
src = info->src;
dst = info->dst;
srcskip = info->src_pitch;
dstskip = info->dst_pitch;
/* Properly handle overlapping blits */
if (src < dst) {
overlap = (dst < (src + h*srcskip));
} else {
overlap = (src < (dst + h*dstskip));
}
if (overlap) {
while (h--) {
SDL_memmove(dst, src, w);
src += srcskip;
dst += dstskip;
}
return;
}
#ifdef __SSE__
if (SDL_HasSSE() &&
!((uintptr_t) src & 15) && !(srcskip & 15) &&
!((uintptr_t) dst & 15) && !(dstskip & 15)) {
while (h--) {
SDL_memcpySSE(dst, src, w);
src += srcskip;
dst += dstskip;
}
return;
}
#endif
#ifdef __MMX__
if (SDL_HasMMX() && !(srcskip & 7) && !(dstskip & 7)) {
while (h--) {
SDL_memcpyMMX(dst, src, w);
src += srcskip;
dst += dstskip;
}
_mm_empty();
return;
}
#endif
while (h--) {
SDL_memcpy(dst, src, w);
src += srcskip;
dst += dstskip;
}
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:304
SDL_BlitInfo::dst_pitch
int dst_pitch
Definition: SDL_blit.h:63
SDL_BlitInfo::dst_h
int dst_h
Definition: SDL_blit.h:62
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:126
SDL_BlitInfo::dst
Uint8 * dst
Definition: SDL_blit.h:61
SDL_memcpy
#define SDL_memcpy
Definition: SDL_dynapi_overrides.h:393
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
uintptr_t
unsigned int uintptr_t
Definition: SDL_config_windows.h:69
SDL_memmove
#define SDL_memmove
Definition: SDL_dynapi_overrides.h:394
SDL_HasMMX
#define SDL_HasMMX
Definition: SDL_dynapi_overrides.h:111
SDL_BlitInfo::src
Uint8 * src
Definition: SDL_blit.h:57
SDL_BlitInfo::dst_fmt
SDL_PixelFormat * dst_fmt
Definition: SDL_blit.h:66
SDL_BlitInfo::src_pitch
int src_pitch
Definition: SDL_blit.h:59
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
SDL_BlitInfo::dst_w
int dst_w
Definition: SDL_blit.h:62
src
GLenum src
Definition: SDL_opengl_glext.h:1737
SDL_HasSSE
#define SDL_HasSSE
Definition: SDL_dynapi_overrides.h:113
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1946