Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix software rendering in the mir backend. The window assumed hardwar…
…e buffer, which caused testdrawchessboard to fail to mmap a buffer.
  • Loading branch information
BrandonSchaefer committed May 2, 2014
1 parent ec5f6ad commit 44a0f1d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/video/mir/SDL_mirframebuffer.c
Expand Up @@ -56,6 +56,8 @@ MIR_CreateWindowFramebuffer(_THIS, SDL_Window* window, Uint32* format,
MIR_Window* mir_window;
MirSurfaceParameters surfaceparm;

mir_data->software = SDL_TRUE;

if (MIR_CreateWindow(_this, window) < 0)
return SDL_SetError("Failed to created a mir window.");

Expand Down
1 change: 1 addition & 0 deletions src/video/mir/SDL_mirvideo.c
Expand Up @@ -273,6 +273,7 @@ MIR_VideoInit(_THIS)
MIR_Data* mir_data = _this->driverdata;

mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
mir_data->software = SDL_FALSE;

if (!MIR_mir_connection_is_valid(mir_data->connection))
return SDL_SetError("Failed to connect to the Mir Server");
Expand Down
2 changes: 2 additions & 0 deletions src/video/mir/SDL_mirvideo.h
Expand Up @@ -32,6 +32,8 @@
typedef struct
{
MirConnection* connection;
SDL_bool software;

} MIR_Data;

#endif /* _SDL_mirvideo_h_ */
Expand Down
3 changes: 3 additions & 0 deletions src/video/mir/SDL_mirwindow.c
Expand Up @@ -99,6 +99,9 @@ MIR_CreateWindow(_THIS, SDL_Window* window)
mir_data = _this->driverdata;
window->driverdata = mir_window;

if (mir_data->software)
surfaceparm.buffer_usage = mir_buffer_usage_software;

if (window->x == SDL_WINDOWPOS_UNDEFINED)
window->x = 0;

Expand Down
1 change: 1 addition & 0 deletions src/video/mir/SDL_mirwindow.h
Expand Up @@ -34,6 +34,7 @@
typedef struct {
SDL_Window* sdl_window;
MIR_Data* mir_data;
bool software;

MirSurface* surface;
EGLSurface egl_surface;
Expand Down

0 comments on commit 44a0f1d

Please sign in to comment.