Do not overwrite window surface created by driver
authorJay Petacat <jay@jayschwa.net>
Sun, 22 Mar 2020 20:09:14 -0400
changeset 13667daed33b4f74a
parent 13666 83df8de77e12
child 13668 db0dcf23f7a5
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).
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Mon Mar 23 11:42:44 2020 -0700
     1.2 +++ b/src/video/SDL_video.c	Sun Mar 22 20:09:14 2020 -0400
     1.3 @@ -2319,6 +2319,10 @@
     1.4          return NULL;
     1.5      }
     1.6  
     1.7 +    if (window->surface) {
     1.8 +        return window->surface;
     1.9 +    }
    1.10 +
    1.11      if (!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
    1.12          return NULL;
    1.13      }