fillOutline method

void fillOutline(
  1. FlattenedOutline outline,
  2. PdfMatrix emToDevice,
  3. int rgba
)

Fills a cached em-space glyph outline through emToDevice (em space -> device pixels): transform-and-bin, no re-flattening. Glyph outlines fill nonzero (ยง9.4).

With a glyphCache attached (the default), the glyph's emitted strips are memoized per (outline identity, matrix quantized to 1/64, subpixel offset quantized to 1/4 px) and replayed with an integer translate + color override - repeat occurrences skip flattening, binning, and fine raster entirely. Quantization moves a glyph by at most 1/8 px; glyphs that leave the viewport (or exceed 512 px a side) bypass the cache and render directly, unquantized.

Implementation

void fillOutline(FlattenedOutline outline, PdfMatrix emToDevice, int rgba) {
  if (_rowCount == 0) return;
  final cache = glyphCache;
  if (cache == null) {
    _fillOutlineDirect(outline, emToDevice, rgba);
    return;
  }
  _fillOutlineCached(cache, outline, emToDevice, rgba);
}