Commit graph

5 commits

Author SHA1 Message Date
Vanand Gasparyan
f3a3488cda Rust: Set import granularity to Item
By default, `rustfmt` persists the import granularity. In practice, most
Rust code has import granularity "Module" due to LSP's actions.

"Item" gets rid of import groupings and achieves cleaner diffs and
better conflict resolution. Better greppability is a positive side
effect.

Note: it's an unstable rustfmt feature. `cargo +nightly fmt` must be
used instead of `cargo fmt`.
2026-05-28 06:52:18 +02:00
Jonathan Gamble
df481377fd LibGfx: Add the mimalloc allocator shim to liblagom-gfx.so
This keeps our Rust crates on the same allocator in shared builds.

This fixes the same ELF debug crash as #9026, where mimalloc detects
heap corruption as soon as liblagom-regex.so starts using the first
allocator it finds.

When generating liblagom-regex.so during shared-library linkage, the
normal linker sees that those allocator symbols are already provided by
liblagom-unicode.so, which it depends on, so the corresponding object
file is not pulled in from libregex_rust.a.

Fast forward to runtime, if liblagom-gfx.so is loaded first, as seems
to happen in debug builds, then its exported allocator is picked up by
liblagom-regex.so instead.
2026-04-27 09:38:48 -04:00
Zaggy1024
726ddf0b92 LibGfx: Move yuv crate binding declarations to a separate module file 2026-04-19 09:06:25 -05:00
Timothy Flynn
e955f5d5e2 LibGfx: Reformat rust module
This code was added while our rustfmt config was in a PR.
2026-04-18 14:22:49 +02:00
Zaggy1024
3cfe1f7542 LibGfx: Implement YUV->RGBA color conversion for CPU painting
Using the Rust yuv crate, eagerly convert from YUV to RGBA on the CPU
when a GPU context is unavailable.

Time spent converting an 8-bit YUV frame with this crate is better than
libyuv on ARM by about 20%, and on x86 with AVX2, it achieves similar
numbers to libyuv.
2026-04-18 01:25:00 -05:00