NoopCanvas
Backend that ignores everything, useful for benchmarks and content-stream sanity tests.
Properties
True when this canvas needs resolved glyph outlines (TextGlyph.outline), i.e. it actually paints (a render backend). Extraction canvases that only read text + advances override this to false, letting the driver skip the cost of resolving glyph outlines. Such a canvas gets every text run through drawGlyphs, also a run that paints nothing, such as invisible OCR text.
Functions
Apply a soft mask to the content rendered inside render (ISO 32000-1 §11.6.5). The default implementation just calls render. Backends without offscreen compositing fall back to painting through the mask.
Set up for a page render. The renderer calls this once before any draw call, with the page dimensions (in PDF user units, 1pt = 1/72 inch) and the desired device CTM (e.g. flip Y and scale to fit a target rectangle).
Open a transparency group (ISO 32000-1 §11.4). Subsequent paints accumulate into an offscreen layer; endTransparencyGroup composites the layer back onto the parent with blendMode + alpha.
Paint one text run, already laid out into glyphs by the document handler. Format-neutral: no PDF (or other) font object crosses the seam, so every handler (PDF, EPUB, and others) drives text the same way.
Paint an XObject Image under ctm. PDF defines the image's bounds as the unit square (0..1, 0..1); the CTM already encodes the scale + position. A canvas paints the pixels of a KiteImageData.Kind.RAW image and draws a placeholder for every other kind. It never throws (#184).
The outline of text in the host face this canvas draws a font without embedded outlines in, chosen from fontSpec as drawGlyphs chooses it. The outline is in glyph space: 1000 units per em, y up, and the pen at the origin on the baseline. A document handler strokes and clips such text with it, since a missing font program does not excuse the stroke (ISO 32000-1, 9.3.6).
Renders the complex shading types, so every backend supports them identically with no code of its own:
Runs step on the pixels of region under ctm, cut to the current clip. Some effects work on what was drawn, not on shapes: an SVG filter blurs or moves the pixels of an element (Filter Effects 1, 15), and a non-isolated transparency group takes the backdrop's part out of its own pixels before it composites (ISO 32000-1, 11.4.8). The step reads the backdrop, has content painted into rasters of the box through this canvas, works on them in plain Kotlin, and draws the result back, all through KiteRasterScope.