♻️ Use a single byte to store gradient stop count (wasm)

This commit is contained in:
Belén Albeza 2025-04-29 14:53:49 +02:00
parent 86a498fc29
commit 8e18a0880e
2 changed files with 5 additions and 3 deletions

View file

@ -25,7 +25,7 @@
(.setFloat32 dview (+ offset 12) end-y true)
(.setFloat32 dview (+ offset 16) opacity true)
(.setFloat32 dview (+ offset 20) width true)
(.setUint32 dview (+ offset 24) (count stops) true)
(.setUint8 dview (+ offset 24) (count stops) true)
(loop [stops (seq stops) offset (+ offset GRADIENT-BASE-SIZE)]
(if (empty? stops)
offset