present method
Decode frame.rgba into a retained image (replaces the previous one).
Latest-wins: if a decode is already in flight, keep only the newest pending frame so TUI scroll floods do not queue N RGBA uploads.
Implementation
Future<void> present(RasterPresentFrame frame) async {
if (_disposed) return;
if (frame.width <= 0 || frame.height <= 0 || frame.rgba.isEmpty) {
return;
}
final seq = ++_presentSeq;
if (_inflightSeq != null) {
_pending = frame;
return;
}
await _decodeAndCommit(frame, seq);
}