skia-engine
The skia-engine crate is the public-facing crate. It re-exports the core
element types, node properties, renderer, and UI macros.
Usage
use ;
use nodes;
use ;
let tree: ElementNode = skia_ui! ;
let mut surface = raster_n32_premul.unwrap;
render_tree;
To use the example, add skia-engine and skia-safe to your application's
dependencies. The macros currently expand to paths in skia_engine_core, so
applications using the macros also need skia-engine-core as a direct
dependency.
RSX-like syntax with skia_rsx!
Use skia_rsx! when you prefer tag-based syntax. Put Rust expressions in
attribute values (braces are supported), and nest child elements inside their
parent:
use ;
use Color;
let tree: ElementNode = skia_rsx! ;
skia_rsx! currently supports Container and Rect elements and the same
properties as skia_ui!. See the skia-engine-macro README for the complete
property list and defaults.
Re-exports
ElementNodeandnodesfor constructing or inspecting element trees.render_treefor drawing an element tree to a Skia canvas.skia_ui!for brace-based nested element syntax.skia_rsx!for RSX-like element syntax.
See the skia-engine-macro crate README for supported elements and properties.