Skip to content

Commit 1742301

Browse files
Return a null image from ImageExternalTextureGL::CreateEGLImage if an EGL display is not available (flutter#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 flutter#149396
1 parent 7f81e71 commit 1742301

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

shell/platform/android/image_external_texture_gl.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ impeller::UniqueEGLImageKHR ImageExternalTextureGL::CreateEGLImage(
8787
}
8888

8989
EGLDisplay display = eglGetCurrentDisplay();
90-
FML_CHECK(display != EGL_NO_DISPLAY);
90+
if (display == EGL_NO_DISPLAY) {
91+
// This could happen when running in a deferred task that executes after
92+
// the thread has lost its EGL state.
93+
return impeller::UniqueEGLImageKHR();
94+
}
9195

9296
EGLClientBuffer client_buffer =
9397
impeller::android::GetProcTable().eglGetNativeClientBufferANDROID(

0 commit comments

Comments
 (0)