mirror of
https://github.com/openwrt/video.git
synced 2026-10-12 05:57:07 +04:00
Make SVG documents loadable and renderable from ucode. A document is a resource type that reports its intrinsic size, computes the extents of the whole drawing or of one element by id, and renders either onto a plutovg canvas or into a fresh surface. CSS currentColor is passed as an ordinary colour value and colour variables resolve through a ucode object or callback invoked during rendering. Script data handed to the loader is copied because the parser keeps pointers into it for the lifetime of the document; the copy is released through the destroy callback. An element id is dereferenced in the frame that owns the argument, as a short ucode string lives inside the variable holding the value. Surfaces returned by the renderer are plutovg resources, so the plutovg module is loaded on demand when it is not already present. Signed-off-by: Daniel Golle <daniel@makrotopia.org>