mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
flatland_connection.cc used to allow an arbitrary number of acquire and release fences to be scheduled for each frame. Sadly, Fuchsia has a limitation of (1) the number of total handles that can be sent per a FIDL call, but also (2) the Flatland protocol only supports sending up to 16 fences per each fence type. Now, normally there should be very few scheduled fences per frame. But if frames get skipped, we could amass many fences which would then crash our attempts to send all of them to the Flatland `Present` endpoint. This change introduces two fence multiplexer, which allow us to signal more than 16 fences per type, at a performance penalty. We expect to be able *not* to crash the FIDL subsystem using this approach, and may even be able to hobble along for a bit, until the fences issue is hopefully self-resolved. That said, this issue seems to indicate there are frame scheduling problems elsewhere. But this is a fairly straightforward change to make without affecting the rest of the flatland code or integration, so we opt to do that first. Issues: [#150136](https://github.com/flutter/engine/pull/53366) - [] I updated/added relevant documentation (doc comments with `///`).