mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 12:32:52 +00:00
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