mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
The EGL context can only be used by a single thread at a time. Currently: 1. The platform thread uses the EGL context to configure the render surface when a `FlutterViewController` is created 2. The raster thread uses the EGL context to render In a multi-view world, a `FlutterViewController` can be created in parallel to a rendering operation. This results in multiple threads attempting to use the EGL context in parallel, which can crash (see https://github.com/flutter/flutter/issues/137973). This change configures the render surface on the raster thread if the raster thread exists (aka the engine is running). Addresses https://github.com/flutter/flutter/issues/137973 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style