[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:
committed by
Ivo van Dongen
parent
7c874ab815
commit
96fef8172b
@@ -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();
|
||||
|
||||
@@ -94,7 +94,9 @@ private:
|
||||
|
||||
void onSurfaceChanged(JNIEnv&, jint width, jint height);
|
||||
|
||||
// Called on Main thread
|
||||
private:
|
||||
// Called on either Main or GL thread //
|
||||
|
||||
void onSurfaceDestroyed(JNIEnv&);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user