noteFrame method

void noteFrame(
  1. ViewportTransform camera,
  2. Size viewport,
  3. double dpr,
  4. int tablesRevision,
)

Every frame, before the draw. Stores the frame's camera, viewport and dpr for the next rebuild, then fires the three frame-read triggers in this order: no collection -> RebuildTrigger.initial; a table revision other than the collection's -> RebuildTrigger.tables; a dpr other than the collection's (exact ==, a stored value) -> RebuildTrigger.devicePixelRatio; a camera outside the band -> RebuildTrigger.band. One reason per frame; they coalesce anyway.

Implementation

void noteFrame(
    ViewportTransform camera, Size viewport, double dpr, int tablesRevision) {
  _camera = camera;
  _viewport = viewport;
  _dpr = dpr;
  final c = _collection;
  if (c == null) {
    markDirty(RebuildTrigger.initial);
    return;
  }
  final banded = inBand(camera);
  if (!banded) bandStaleFrames++;
  if (tablesRevision != c.tablesRevision) {
    markDirty(RebuildTrigger.tables);
  } else if (dpr != c.devicePixelRatio) {
    markDirty(RebuildTrigger.devicePixelRatio);
  } else if (!banded) {
    markDirty(RebuildTrigger.band);
  }
}