mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 21:12:57 -05:00
color_image_owned cast the raster's Vec<u8> to egui's Color32, which is aligned to 4 bytes, so bytemuck's try_cast_vec always failed and the fallback copied the whole frame: about 20 MB at 2880 x 1800 on every full-frame upload, despite its doc comment. The renderer now also renders into a Vec<u32> (render_words, render_plain_patch_words, render_region_words). Over transparency the vello context draws straight into those words; frames that compose offscreen, blend in CMYK, show an opacity mask or are supersampled are converted once. color_image_owned takes that buffer and hands it to egui as Color32 in place. The canvas frame, the render worker's frames, pan fills, split panes, edit parts and the region previews (stroke and artboard images, graphic style swatches, the PDF page preview, the flattener preview) use it.