Serialize solid fills as bytes (wasm)

This commit is contained in:
Belén Albeza 2025-04-29 16:20:45 +02:00
parent 81f18ad7f4
commit 093fa18839
7 changed files with 73 additions and 24 deletions

View file

@ -217,8 +217,12 @@
image (:fill-image fill)]
(cond
(some? color)
(let [rgba (sr-clr/hex->u32argb color opacity)]
(h/call wasm/internal-module "_add_shape_solid_fill" rgba))
(let [size sr-fills/SOLID-BYTE-SIZE
offset (mem/alloc-bytes size)
heap (mem/get-heap-u32)
argb (sr-clr/hex->u32argb color opacity)]
(sr-fills/write-solid-fill! offset heap argb)
(h/call wasm/internal-module "_add_shape_solid_fill"))
(some? gradient)
(let [size sr-fills/GRADIENT-BYTE-SIZE