From 5620ced60e2a3da29db872298436736fd07d15bf Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 27 Jul 2018 17:35:05 -0700 Subject: [PATCH] Clear the EGL context only if our context is currently active Fixes https://github.com/flutter/flutter/issues/19566 --- shell/platform/android/android_context_gl.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index 08744ace7bc37..b61f4ec7433c8 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -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";