summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2016-03-07 15:27:56 -0500
committerTobrun <tobrun.van.nuland@gmail.com>2016-03-07 21:46:11 -0500
commit46986c665e8e1d9902a68cc9ba21303713f24bfc (patch)
treeca3515b572bb4621ca37c385d3ebc4725d880627
parent30c753e7c4e0f7697bd51a70dd697b0adcb52540 (diff)
downloadqtlocation-mapboxgl-46986c665e8e1d9902a68cc9ba21303713f24bfc.tar.gz
[android] #2996 - test workaround for device not sharing context
-rwxr-xr-xplatform/android/src/native_map_view.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index d32f3c81cb..4634c2aec3 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -429,6 +429,11 @@ void NativeMapView::createSurface(ANativeWindow *window_) {
oldDisplay = display;
}
+ if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) {
+ mbgl::Log::Error(mbgl::Event::OpenGL,"eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError());
+ throw new std::runtime_error("eglMakeCurrent() failed");
+ }
+
if (!eglMakeCurrent(oldDisplay, oldDrawSurface, oldReadSurface, oldContext)) {
mbgl::Log::Error(mbgl::Event::OpenGL,
"eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError());