1
0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-08-14 05:16:43 +02:00

🎉 Add shapes buffer to improve memory allocation

This commit is contained in:
Alejandro Alonso 2025-05-09 12:36:04 +02:00
commit 03b4fe3558
9 changed files with 122 additions and 36 deletions
frontend/src/app/render_wasm

View file

@ -842,9 +842,12 @@
(defn initialize
[base-objects zoom vbox background]
(let [rgba (sr-clr/hex->u32argb background 1)]
(let [rgba (sr-clr/hex->u32argb background 1)
shapes (into [] (vals base-objects))
total-shapes (count shapes)]
(h/call wasm/internal-module "_set_canvas_background" rgba)
(h/call wasm/internal-module "_set_view" zoom (- (:x vbox)) (- (:y vbox)))
(h/call wasm/internal-module "_init_shapes_pool" total-shapes)
(set-objects base-objects)))
(def ^:private canvas-options