diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2019-02-22 15:01:55 +0200 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2019-02-23 09:42:50 +0200 |
commit | 96fef8172b2e9484b0631961d36aac0f381c00bf (patch) | |
tree | 0445821e95fd073af66a577b66a07cfcb4054f2c /platform/android/src/map_renderer.cpp | |
parent | 7c874ab815fed39f8655bda313d1c469f14cac2d (diff) | |
download | qtlocation-mapboxgl-96fef8172b2e9484b0631961d36aac0f381c00bf.tar.gz |
[android] re-create renderer on surface update after app backgrounding (in case egl context is preserved, but surface is not)
Diffstat (limited to 'platform/android/src/map_renderer.cpp')
-rw-r--r-- | platform/android/src/map_renderer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/android/src/map_renderer.cpp b/platform/android/src/map_renderer.cpp index cff021afd2..cd8953e4cf 100644 --- a/platform/android/src/map_renderer.cpp +++ b/platform/android/src/map_renderer.cpp @@ -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(); |