Detach the newly created EGL context from the main thread in the embedder unit tests (flutter/engine#24908)

The EGL context will be used by other threads during test execution, and it
should not be active on multiple threads at the same time.  This was not
noticed previously because SwiftShader was not checking for this, but other
EGL implementations may enforce this constraint.
This commit is contained in:
Jason Simmons
2021-03-10 11:29:48 -08:00
committed by GitHub
parent 9a28a147ac
commit 0d98a065b9

View File

@@ -115,6 +115,7 @@ void EmbedderTestContextGL::SetupCompositor() {
<< "Set up the GL surface before setting up a compositor.";
compositor_ = std::make_unique<EmbedderTestCompositorGL>(
gl_surface_->GetSurfaceSize(), gl_surface_->GetGrContext());
GLClearCurrent();
}
} // namespace testing