[android] re-create renderer on surface update after app backgrounding (in case egl context is preserved, but surface is not)

This commit is contained in:
Ivo van Dongen
2019-02-22 15:01:55 +02:00
committed by Ivo van Dongen
parent 7c874ab815
commit 96fef8172b
2 changed files with 9 additions and 2 deletions

View File

@@ -184,7 +184,12 @@ void MapRenderer::onSurfaceCreated(JNIEnv&) {
}
}
void MapRenderer::onSurfaceChanged(JNIEnv&, jint width, jint height) {
void MapRenderer::onSurfaceChanged(JNIEnv& env, jint width, jint height) {
if (!renderer) {
// In case the surface has been destroyed (due to app back-grounding)
onSurfaceCreated(env);
}
backend->resizeFramebuffer(width, height);
framebufferSizeChanged = true;
requestRender();