Files
pdfcraft/crates/render
mtlcl410andClaude Opus 5.5 dc25392da8 M2: a page of stencil masks painted with a tiling pattern draws in seconds instead of running out of memory
A stencil mask (/ImageMask) painted with a pattern was drawn through a
luminance mask, which vello_cpu only takes at canvas size: every draw
rendered, converted and composited a full-page mask. And a tiling
pattern's cell pixmap was drawn again for every fill, each copy kept
until the page was composited. pdf.js issue 8078 paints 73,047 16 x 16
stencils with one pattern whose cell is 3.5 MB at 36 dpi: the render
ran for 5 minutes and then failed to allocate.

hayro patch (30): the stencil is drawn under a clip of its device
rectangle (padded by two pixels for a stencil snapped to whole pixels),
the pattern in an isolated layer cut to the stencil by a layer holding
it composited with Compose::DestIn (ISO 32000-2 8.9.6.2: the pattern
shows where the mask's samples paint). A coloured tiling pattern's cell
is drawn once per setting of the pattern and cell scale (TilingCells,
eight entries per renderer). hayro-interpret patch (78) numbers each
setting of a tiling pattern (TilingPattern::instance).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
2026-11-05 21:09:36 +08:00
..