Commit Graph
5 Commits
Author SHA1 Message Date
Khawar Zamman Wani cc6837355b perf(paint): accumulate serial dabs in place with packed tile keys 2026-10-27 18:26:47 +05:30
360e0920fc Integration: parallel brush composite keeps the document's CMYK profile (#7218)
The document's CMYK profile is active per thread (with_cmyk_space), and the
parallel composite ran its tiles on rayon workers outside that scope. On a
CMYK document with its own profile, every blend mode other than Normal and
Dissolve then converted those tiles through the built-in coated CMYK: a 40 px
Multiply line 1100 px long (17+ tiles, parallel at the default threshold)
differed from the serial path in 256384 samples. The workers now enter the
caller's CMYK space, as the compositor and gpu crates do.

Test: a_parallel_composite_converts_through_the_documents_cmyk_profile fails
without the fix.

Co-authored-by: Unemars <62496697+Unemars@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:31:34 +02:00
UnemarsandClaude Fable 5.1 7deeaeeba1 Brush: large tips rasterize, accumulate and composite in parallel
A 2000 px soft tip is a 12 MP dab, and every dab ran on one thread: the tip's
coverage (92 ms), its accumulation into the stroke's tiles (44 ms) and the
composite of the dirty tiles into the layer (177 ms), about 300 ms a dab, so a
stroke across a 24 MP photo lagged by a quarter second per frame. Photoshop
keeps such strokes fluid by spreading them over the cores.

Each stage is independent per row (the round tip's coverage) or per tile (the
accumulation, the composite), so they now run on the thread pool from 256²
pixels of work up, to the same pixels: the per-pixel maths is untouched, the
dither and Dissolve hash positions, and a test renders a 700 px soft stroke,
a Dissolve stroke and a per-dab-colour stroke (with a selection, 8-bit) both
ways and compares every pixel. Below the threshold, and on the web, nothing
changes. The composite's writes to the layer stay in order; its tiles are
composited in batches so the pending regions stay small.

`examples/big_dab_bench.rs` prints the stages of one dab. On a loaded 16-thread
machine the 12 MP dab went from about 300 ms to 100–140 ms; the hard 2000 px
tip from 75 to 35 ms.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-18 01:16:29 +02:00
Brandon Thomas 536a7346fb more algorithms, progress 2026-10-01 08:25:06 -04:00
Brandon Thomas 16941f7198 one-shot 2026-09-30 05:02:08 -04:00