mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-23 18:51:07 +00:00
Do not overwrite window surface created by driver
If a driver's implementation of CreateWindowFramebuffer sets the window surface, use that rather than overwriting it. A driver may set the window surface if data cannot be passed via the CreateWindowFramebuffer output parameters (e.g. surface palette colors).
This commit is contained in:
parent
1fd548b67a
commit
e0a270561f
|
@ -2319,6 +2319,10 @@ SDL_CreateWindowFramebuffer(SDL_Window * window)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window->surface) {
|
||||||
|
return window->surface;
|
||||||
|
}
|
||||||
|
|
||||||
if (!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
|
if (!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue