@@ -398,6 +398,11 @@ void NativeMapView::createSurface(ANativeWindow *window_) {
|
||||
if (!firstTime) {
|
||||
firstTime = true;
|
||||
|
||||
EGLDisplay oldDisplay = eglGetCurrentDisplay();
|
||||
EGLSurface oldReadSurface = eglGetCurrentSurface(EGL_READ);
|
||||
EGLSurface oldDrawSurface = eglGetCurrentSurface(EGL_DRAW);
|
||||
EGLContext oldContext = eglGetCurrentContext();
|
||||
|
||||
if (!eglMakeCurrent(display, surface, surface, context)) {
|
||||
mbgl::Log::Error(mbgl::Event::OpenGL, "eglMakeCurrent() returned error %d",
|
||||
eglGetError());
|
||||
@@ -418,7 +423,7 @@ void NativeMapView::createSurface(ANativeWindow *window_) {
|
||||
return reinterpret_cast<mbgl::gl::glProc>(eglGetProcAddress(name));
|
||||
});
|
||||
|
||||
if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) {
|
||||
if (!eglMakeCurrent(oldDisplay, oldDrawSurface, oldReadSurface, oldContext)) {
|
||||
mbgl::Log::Error(mbgl::Event::OpenGL,
|
||||
"eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError());
|
||||
throw new std::runtime_error("eglMakeCurrent() failed");
|
||||
|
||||
Reference in New Issue
Block a user