Clear the EGL context only if our context is currently active (flutter/engine#5895)

Fixes https://github.com/flutter/flutter/issues/19566
This commit is contained in:
Jason Simmons
2018-07-30 09:52:39 -07:00
committed by GitHub
parent d1cc979466
commit 332832d84c

View File

@@ -222,6 +222,9 @@ bool AndroidContextGL::MakeCurrent() {
}
bool AndroidContextGL::ClearCurrent() {
if (eglGetCurrentContext() != context_) {
return true;
}
if (eglMakeCurrent(environment_->Display(), EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT) != EGL_TRUE) {
FML_LOG(ERROR) << "Could not clear the current context";