cranpose-render-common 0.25.0

Scene, renderer and hit-test contracts for Cranpose backends
Documentation

Cranpose Render Common

cranpose-render-common defines scene, renderer and hit-test contracts for Cranpose backends. Backend authors implement Renderer and RenderScene. App developers select a renderer through cranpose.

Describe the layers that a window draws over its scene and read the records they become:

use cranpose_render_common::scene_store::{OverlayLayer, SceneStore};
use cranpose_ui_graphics::{Point, Size};

let badge = OverlayLayer {
    size: Size::new(80.0, 24.0),
    origin: Point::new(8.0, 8.0),
    primitives: Vec::new(),
};
let mut store = SceneStore::new();
store.describe_overlay(Size::new(320.0, 240.0), [&badge]);
assert_eq!(store.node_count(), 2);

The Renderer contract accepts a LayoutTree or a MemoryApplier root and a logical-pixel viewport. AppShell installs renderer services before the first composition pass. Default features include embedded-default-font, which supplies a fallback font. See the Renderer API, the renderer architecture guide, the renderer source and the crate source.