readback method
Refuses what the contract refuses, records the rest, and answers zeros unless answerReadback says otherwise.
Implementation
@override
Future<ByteData> readback(TextureHandle texture, {ScreenRect? region}) {
final resolved = readbackRegionOf(texture, region);
readbacks.add((texture: texture, region: resolved));
final answer = answerReadback;
return Future<ByteData>.value(
answer == null
? ByteData(resolved.width * resolved.height * 4)
: answer(texture, resolved),
);
}