mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
sdl: fix: concurrent drawing on Windows
On Windows, we need to prevent the event thread from drawing at the same time as the main thread, when window is being adjusted. Change-Id: I2b4e4a50fec427e53e310593850e2a556a594b31
This commit is contained in:
parent
0a88b818e9
commit
fa8b095f29
5 changed files with 18 additions and 0 deletions
|
@ -102,6 +102,9 @@ void sdl_gui_update(SDL_Surface *surface, int x_start, int y_start, int width,
|
|||
SDL_Rect dest= {ui_x + x_start, ui_y + y_start, width, height};
|
||||
|
||||
uint8_t alpha;
|
||||
|
||||
SDL_LockMutex(window_mutex);
|
||||
|
||||
if (SDL_GetSurfaceAlphaMod(surface,&alpha) == 0 && alpha < 255)
|
||||
SDL_FillRect(sim_lcd_surface, NULL, 0); /* alpha needs a black background */
|
||||
|
||||
|
@ -111,6 +114,7 @@ void sdl_gui_update(SDL_Surface *surface, int x_start, int y_start, int width,
|
|||
|
||||
if (!sdl_window_adjust()) /* already calls sdl_window_render itself */
|
||||
sdl_window_render();
|
||||
SDL_UnlockMutex(window_mutex);
|
||||
}
|
||||
|
||||
/* set a range of bitmap indices to a gradient from startcolour to endcolour */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue