From 46986c665e8e1d9902a68cc9ba21303713f24bfc Mon Sep 17 00:00:00 2001 From: Tobrun Date: Mon, 7 Mar 2016 15:27:56 -0500 Subject: [PATCH] [android] #2996 - test workaround for device not sharing context --- platform/android/src/native_map_view.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index d32f3c81cbf..4634c2aec3e 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());