emitBatch method

  1. @override
void emitBatch(
  1. int ordinal,
  2. StripBatchData? data
)

Called at every flush point with the strips binned since the previous one (data null when nothing was binned, or when binningEnabled is off). ordinal is the flush point's 0-based index.

Implementation

@override
void emitBatch(int ordinal, StripBatchData? data) {
  final plan = _plan;
  if (plan != null) {
    StripBatchData? planData;
    if (_planNext < plan.batches.length &&
        plan.batches[_planNext].flushOrdinal == ordinal) {
      planData = plan.batches[_planNext++];
    }
    if (debugVerifyPrecomputed) _verifyAgainstPlan(ordinal, data, planData);
    data = planData;
  }
  if (data == null) return;
  final batch = StripBatch.fromData(data);
  _tape.add(batch);
  _batches.add(batch);
  totalFlushes++;
  totalStripQuads += batch.stripCount;
  totalAtlasTexels += batch.atlasWidth * batch.atlasHeight;
}