Fix recycler view test (#3537)
This commit is contained in:
@@ -234,8 +234,14 @@ void MapRenderer::onSurfaceCreated(JNIEnv& env, const jni::Object<AndroidSurface
|
||||
// The android system will have already destroyed the underlying
|
||||
// GL resources if this is not the first initialization and an
|
||||
// attempt to clean them up will fail
|
||||
if (backend) backend->markContextLost();
|
||||
if (renderer) renderer->markContextLost();
|
||||
if (backend) {
|
||||
gfx::BackendScope backendGuard{backend->getImpl()};
|
||||
backend->markContextLost();
|
||||
}
|
||||
|
||||
if (renderer) {
|
||||
renderer->markContextLost();
|
||||
}
|
||||
|
||||
// Reset in opposite order
|
||||
renderer.reset();
|
||||
@@ -270,12 +276,14 @@ void MapRenderer::onSurfaceCreated(JNIEnv& env, const jni::Object<AndroidSurface
|
||||
}
|
||||
}
|
||||
|
||||
void MapRenderer::onSurfaceChanged(JNIEnv& env, jint width, jint height) {
|
||||
void MapRenderer::onSurfaceChanged([[maybe_unused]] JNIEnv& env, jint width, jint height) {
|
||||
#if MLN_RENDER_BACKEND_OPENGL
|
||||
if (!renderer) {
|
||||
// In case the surface has been destroyed (due to app back-grounding)
|
||||
jni::jobject* nullObj = nullptr;
|
||||
onSurfaceCreated(env, jni::Object<AndroidSurface>(nullObj));
|
||||
}
|
||||
#endif
|
||||
|
||||
backend->resizeFramebuffer(width, height);
|
||||
framebufferSizeChanged = true;
|
||||
|
||||
Reference in New Issue
Block a user