[Impeller] Fix OpenGLES EGL_BAD_ACCESS due to context being current on multiple threads. (flutter/engine#46287)

On Linux setting the EGL context from one thread, then setting from another thread will trigger a EGL_BAD_ACCESS error.  The resolution is to clear the context after use on the thread that set it.

https://github.com/flutter/flutter/issues/130619
This commit is contained in:
Joel Winarske
2023-09-28 13:10:09 -07:00
committed by GitHub
parent 86b582a6bc
commit 40b832a838

View File

@@ -86,13 +86,13 @@ EmbedderSurfaceGLImpeller::EmbedderSurfaceGLImpeller(
return;
}
worker_->SetReactionsAllowedOnCurrentThread(true);
auto worker_id = impeller_context_->AddReactorWorker(worker_);
if (!worker_id.has_value()) {
FML_LOG(ERROR) << "Could not add reactor worker.";
return;
}
gl_dispatch_table_.gl_clear_current_callback();
FML_LOG(ERROR) << "Using the Impeller rendering backend (OpenGL).";
valid_ = true;
}