From 0d98a065b9c53948f089438955933f048aa6dd8d Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 10 Mar 2021 11:29:48 -0800 Subject: [PATCH] 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. --- .../shell/platform/embedder/tests/embedder_test_context_gl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context_gl.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context_gl.cc index 243e1d9864..9a7bc9bcf1 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context_gl.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_test_context_gl.cc @@ -115,6 +115,7 @@ void EmbedderTestContextGL::SetupCompositor() { << "Set up the GL surface before setting up a compositor."; compositor_ = std::make_unique( gl_surface_->GetSurfaceSize(), gl_surface_->GetGrContext()); + GLClearCurrent(); } } // namespace testing