record method

void record({
  1. required Duration renderDuration,
  2. required DegradationLevel degradationLevel,
  3. int? width,
  4. int? height,
})

Records a render frame.

Implementation

void record({
  required Duration renderDuration,
  required DegradationLevel degradationLevel,
  int? width,
  int? height,
}) {
  final us = renderDuration.inMicroseconds;
  _frameCount++;
  _totalRenderUs += us;
  _lastRenderUs = us;
  if (_frameCount == 1) {
    _minRenderUs = us;
    _maxRenderUs = us;
  } else {
    if (us < _minRenderUs) _minRenderUs = us;
    if (us > _maxRenderUs) _maxRenderUs = us;
  }
  _lastDegradation = degradationLevel;
  _lastWidth = width;
  _lastHeight = height;
}