summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-09-15 18:01:06 +0300
committerIvo van Dongen <info@ivovandongen.nl>2017-09-18 10:07:05 +0300
commit3f80093acf21230c9085b29bd8a43d1dffa09029 (patch)
treef764ce18049c201a6ade3bff419c3fbf2b301f6a
parented7414eb5c0c26b8b43661423081862439a82e4b (diff)
downloadqtlocation-mapboxgl-3f80093acf21230c9085b29bd8a43d1dffa09029.tar.gz
[android] renderer backend rename markContextAbandoned
-rwxr-xr-xplatform/android/src/android_renderer_backend.cpp2
-rwxr-xr-xplatform/android/src/android_renderer_backend.hpp2
-rw-r--r--platform/android/src/map_renderer.cpp9
3 files changed, 6 insertions, 7 deletions
diff --git a/platform/android/src/android_renderer_backend.cpp b/platform/android/src/android_renderer_backend.cpp
index 536090ddec..a76b996512 100755
--- a/platform/android/src/android_renderer_backend.cpp
+++ b/platform/android/src/android_renderer_backend.cpp
@@ -54,7 +54,7 @@ void AndroidRendererBackend::updateAssumedState() {
}
-void AndroidRendererBackend::abandonContext() {
+void AndroidRendererBackend::markContextLost() {
if (context) {
context->setCleanupOnDestruction(false);
}
diff --git a/platform/android/src/android_renderer_backend.hpp b/platform/android/src/android_renderer_backend.hpp
index 16cc782132..4230e55356 100755
--- a/platform/android/src/android_renderer_backend.hpp
+++ b/platform/android/src/android_renderer_backend.hpp
@@ -14,7 +14,7 @@ public:
// Ensures the current context is not
// cleaned up when destroyed
- void abandonContext();
+ void markContextLost();
void updateViewPort();
diff --git a/platform/android/src/map_renderer.cpp b/platform/android/src/map_renderer.cpp
index 72338c84e5..b41984ab62 100644
--- a/platform/android/src/map_renderer.cpp
+++ b/platform/android/src/map_renderer.cpp
@@ -110,11 +110,10 @@ void MapRenderer::onSurfaceCreated(JNIEnv&) {
std::lock_guard<std::mutex> lock(initialisationMutex);
- if (backend) {
- // The android system will have already destroyed the underlying
- // GL resources and an attempt to clean them up will fail
- backend->abandonContext();
- }
+ // The android system will have already destroyed the underlying
+ // GL resources if this is not the first intialization and an
+ // attempt to clean them up will fail
+ if (backend) backend->markContextLost();
// Reset in opposite order
renderer.reset();