endFrame method
Closes the frame opened by beginFrame.
Implementation
void endFrame({required int pipelineCacheSize}) {
final frame = _active;
if (frame == null) return;
_frameWatch.stop();
frame.cpuMicros = _frameWatch.elapsedMicroseconds;
frame.pipelineCacheSize = pipelineCacheSize;
frame.counters.setDelta(_frameStart, activeRenderCounters);
_active = null;
_latest = frame;
_frameCount++;
if (historyLength <= 0) {
_history.clear();
return;
}
_history.add(frame);
while (_history.length > historyLength) {
_history.removeAt(0);
}
}