Fix flixker after switch

This commit is contained in:
Leith Bade
2014-11-10 00:23:09 +11:00
parent b6616f0aa3
commit 6b65aa62a1
4 changed files with 27 additions and 15 deletions

View File

@@ -284,22 +284,26 @@ bool NativeMapView::createSurface(ANativeWindow* window_) {
return false;
}
if (!eglMakeCurrent(display, surface, surface, context)) {
LOG_ERROR("eglMakeCurrent() returned error %d", eglGetError());
}
if (!first_time) {
first_time = true;
log_gl_string(GL_VENDOR, "Vendor");
log_gl_string(GL_RENDERER, "Renderer");
log_gl_string(GL_VERSION, "Version");
log_gl_string(GL_SHADING_LANGUAGE_VERSION, "SL Version"); // In the emulator this returns NULL with error code 0? https://code.google.com/p/android/issues/detail?id=78977
log_gl_string(GL_EXTENSIONS, "Extensions");
if (!eglMakeCurrent(display, surface, surface, context)) {
LOG_ERROR("eglMakeCurrent() returned error %d", eglGetError());
}
loadExtensions();
log_gl_string(GL_VENDOR, "Vendor");
log_gl_string(GL_RENDERER, "Renderer");
log_gl_string(GL_VERSION, "Version");
log_gl_string(GL_SHADING_LANGUAGE_VERSION, "SL Version"); // In the emulator this returns NULL with error code 0? https://code.google.com/p/android/issues/detail?id=78977
log_gl_string(GL_EXTENSIONS, "Extensions");
if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT)) {
LOG_ERROR("eglMakeCurrent(EGL_NO_CONTEXT) returned error %d",
eglGetError());
loadExtensions();
if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT)) {
LOG_ERROR("eglMakeCurrent(EGL_NO_CONTEXT) returned error %d",
eglGetError());
}
}
resume();