Fixed bug 4669: Android software renderer, black screen when window resizes
authorSylvain Becker <sylvain.becker@gmail.com>
Mon, 17 Jun 2019 22:31:36 +0200
changeset 12871ab4d52e38c42
parent 12870 45b56ed51919
child 12872 c4db6eade632
Fixed bug 4669: Android software renderer, black screen when window resizes

Using the software SDL_Renderer on Android leads to GL errors & black screen when window resizes
src/core/android/SDL_android.c
src/video/android/SDL_androidevents.c
src/video/android/SDL_androidvideo.c
src/video/android/SDL_androidvideo.h
     1.1 --- a/src/core/android/SDL_android.c	Mon Jun 17 11:10:20 2019 -0700
     1.2 +++ b/src/core/android/SDL_android.c	Mon Jun 17 22:31:36 2019 +0200
     1.3 @@ -732,7 +732,7 @@
     1.4  
     1.5      if (Android_Window)
     1.6      {
     1.7 -        Android_SendResize(Android_Window);
     1.8 +        Android_send_resize = 1;
     1.9      }
    1.10  
    1.11      SDL_UnlockMutex(Android_ActivityMutex);
     2.1 --- a/src/video/android/SDL_androidevents.c	Mon Jun 17 11:10:20 2019 -0700
     2.2 +++ b/src/video/android/SDL_androidevents.c	Mon Jun 17 22:31:36 2019 +0200
     2.3 @@ -66,6 +66,11 @@
     2.4              event.type = SDL_RENDER_DEVICE_RESET;
     2.5              SDL_PushEvent(&event);
     2.6          }
     2.7 +
     2.8 +        if (Android_send_resize) {
     2.9 +            Android_send_resize = 0;
    2.10 +            Android_SendResize(window);
    2.11 +        }
    2.12      }
    2.13  }
    2.14  
     3.1 --- a/src/video/android/SDL_androidvideo.c	Mon Jun 17 11:10:20 2019 -0700
     3.2 +++ b/src/video/android/SDL_androidvideo.c	Mon Jun 17 22:31:36 2019 +0200
     3.3 @@ -69,6 +69,7 @@
     3.4  SDL_sem *Android_PauseSem          = NULL;
     3.5  SDL_sem *Android_ResumeSem         = NULL;
     3.6  SDL_mutex *Android_ActivityMutex   = NULL;
     3.7 +int Android_send_resize            = 0;
     3.8  
     3.9  static int
    3.10  Android_Available(void)
     4.1 --- a/src/video/android/SDL_androidvideo.h	Mon Jun 17 11:10:20 2019 -0700
     4.2 +++ b/src/video/android/SDL_androidvideo.h	Mon Jun 17 22:31:36 2019 +0200
     4.3 @@ -44,6 +44,7 @@
     4.4  extern int Android_SurfaceHeight;
     4.5  extern SDL_sem *Android_PauseSem, *Android_ResumeSem;
     4.6  extern SDL_mutex *Android_ActivityMutex;
     4.7 +extern int Android_send_resize;
     4.8  
     4.9  #endif /* SDL_androidvideo_h_ */
    4.10