debugEmptyFrameDiagnosis static method
Diagnoses a frame that issued zero draw calls, for renderViews.
Returns the message to print (null when nothing should print) and the
next state of the once-only latch. A frame that drew (drewSomething)
clears the latch so a later regression prints again; a blank frame prints
one message the first time and stays silent until a frame draws. The
caller invokes this inside an assert, so neither it nor the scan feeding
it costs anything in a release build.
Implementation
@visibleForTesting
static ({String? message, bool warned}) debugEmptyFrameDiagnosis({
required bool warned,
required bool drewSomething,
required bool regionEmpty,
required bool noViews,
required bool noScreenViews,
required int meshCount,
required int visibleMeshCount,
required bool anyLayerMaskZero,
required List<int> screenViewMasks,
required int visibleLayersUnion,
}) {
if (drewSomething) return (message: null, warned: false);
if (warned) return (message: null, warned: true);
final cause = _blankFrameCause(
regionEmpty: regionEmpty,
noViews: noViews,
noScreenViews: noScreenViews,
meshCount: meshCount,
visibleMeshCount: visibleMeshCount,
anyLayerMaskZero: anyLayerMaskZero,
screenViewMasks: screenViewMasks,
visibleLayersUnion: visibleLayersUnion,
);
return (
message: 'Flutter Scene rendered a blank frame (zero draw calls). $cause',
warned: true,
);
}