[android] Re-initialise renderer, backend and context when the android system destroyed the underlying gl resources

This commit is contained in:
Ivo van Dongen
2017-09-13 14:34:05 +03:00
committed by Ivo van Dongen
parent 6211db6968
commit 67285f3a95
7 changed files with 99 additions and 45 deletions

View File

@@ -1,5 +1,7 @@
#include "android_renderer_backend.hpp"
#include <mbgl/gl/context.hpp>
#include <EGL/egl.h>
#include <cassert>
@@ -51,5 +53,11 @@ void AndroidRendererBackend::updateAssumedState() {
assumeViewport(0, 0, getFramebufferSize());
}
void AndroidRendererBackend::markContextLost() {
if (context) {
context->setCleanupOnDestruction(false);
}
}
}
} // namespace android
} // namspace mbgl