26 #include "../../SDL_internal.h" 28 #if SDL_VIDEO_DRIVER_MIR 36 static const Uint32 mir_pixel_format_to_sdl_format[] = {
50 MIR_GetSDLPixelFormat(MirPixelFormat
format)
52 return mir_pixel_format_to_sdl_format[
format];
85 MirGraphicsRegion region;
88 int bytes_per_pixel, bytes_per_row, s_stride, d_stride;
92 bs = MIR_mir_surface_get_buffer_stream(mir_window->
surface);
93 MIR_mir_buffer_stream_get_graphics_region(bs, ®ion);
95 s_dest = region.vaddr;
99 d_stride = region.stride;
102 for (i = 0; i < numrects; i++) {
103 s_dest = region.vaddr;
111 if (w <= 0 || h <= 0 || (x + w) <= 0 || (y +
h) <= 0)
124 if (x + w > window->
w)
126 if (y + h > window->
h)
129 start = y * s_stride +
x;
133 bytes_per_row = bytes_per_pixel *
w;
134 for (j = 0; j <
h; j++) {
135 memcpy(s_dest, pixels, bytes_per_row);
141 MIR_mir_buffer_stream_swap_buffers_sync(bs);
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
uint32_t Uint32
An unsigned 32-bit integer type.
int MIR_CreateWindowFramebuffer(_THIS, SDL_Window *sdl_window, Uint32 *format, void **pixels, int *pitch)
GLint GLint GLint GLint GLint x
int MIR_CreateWindow(_THIS, SDL_Window *window)
MirPixelFormat pixel_format
#define SDL_BYTESPERPIXEL(X)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
static SDL_VideoDevice * _this
GLint GLint GLint GLint GLint GLint y
int MIR_UpdateWindowFramebuffer(_THIS, SDL_Window *sdl_window, const SDL_Rect *rects, int numrects)
void MIR_DestroyWindowFramebuffer(_THIS, SDL_Window *sdl_window)
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)
#define SDL_OutOfMemory()
The type used to identify a window.
SDL_Rect rects[MAX_RECTS]
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
A rectangle, with the origin at the upper left.
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 int in j)