5bdd57664eeb17dfa46b90a11938008394399ec7
This fixes the `WindowsTest.EngineCanTransitionToHeadless` flakiness reported by @matanlurey. EGL surfaces can only be used by a single thread at a time. Concurrent operations are unsafe. Previously, the EGL surface was destroyed on the platform thread. This was safe as this always happened after the engine was shutdown and the raster thread was stopped. However, in a multi-view world a view can be destroyed while the engine is running. There may be pending raster tasks that operate on the render surface. Thus, the EGL surfaces should be destroyed on the raster thread when it is available. This bug was introduced by https://github.com/flutter/engine/pull/51681 Part of https://github.com/flutter/flutter/issues/142845 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Description
Languages
Dart
75.4%
C++
16.4%
Objective-C++
2.7%
Java
2.7%
Objective-C
0.6%
Other
1.8%