Return a null image from ImageExternalTextureGL::CreateEGLImage if an EGL display is not available (flutter/engine#53594)
Previously CreateEGLImage had been failing an assertion if an EGL display is not active on the calling thread. CreateEGLImage should not assert here because it could be called from a deferred task that runs after the raster thread has lost its EGL state. See https://github.com/flutter/flutter/issues/149396
This commit is contained in:
@@ -87,7 +87,11 @@ impeller::UniqueEGLImageKHR ImageExternalTextureGL::CreateEGLImage(
|
||||
}
|
||||
|
||||
EGLDisplay display = eglGetCurrentDisplay();
|
||||
FML_CHECK(display != EGL_NO_DISPLAY);
|
||||
if (display == EGL_NO_DISPLAY) {
|
||||
// This could happen when running in a deferred task that executes after
|
||||
// the thread has lost its EGL state.
|
||||
return impeller::UniqueEGLImageKHR();
|
||||
}
|
||||
|
||||
EGLClientBuffer client_buffer =
|
||||
impeller::android::GetProcTable().eglGetNativeClientBufferANDROID(
|
||||
|
||||
Reference in New Issue
Block a user