cvkg_compositor/lib.rs
1//! # CVKG Compositor
2//!
3//! Retained-mode layer orchestration engine for the CVKG UI framework.
4//!
5//! The compositor sits between `cvkg-vdom` and `cvkg-render-gpu`, providing:
6//! - **Material Routing**: Organizes draw calls into GPU pass buckets (scene, glass, overlay).
7//! - **Damage Tracking**: Tracks which layers changed to avoid re-recording static content.
8//! - **Layer Orchestration**: Maintains a retained `LayerTree` with Z-sorting and hierarchy.
9//!
10//! ## Architecture
11//!
12//! ```text
13//! VDom → LayerTreeBuilder → CompositorEngine → SurtrRenderer
14//! │
15//! ┌─────────┼─────────┐
16//! ▼ ▼ ▼
17//! scene_cmds glass_cmds overlay_cmds
18//! │ │ │
19//! ▼ ▼ ▼
20//! ┌─────────────────────────────┐
21//! │ Backdrop Capture Pipeline │
22//! │ (Scene→Blur→Composite→UI) │
23//! └─────────────────────────────┘
24//! ```
25
26pub mod engine;
27pub mod layer;
28
29// Re-export primary types for convenience.
30pub use engine::{CommandBuckets, CompositorEngine, DamageInfo, RoutedDrawCommand};
31pub use layer::{DrawCommand, Layer, LayerId, LayerTree, Material};
32
33/// Current version of the cvkg-compositor crate.
34pub const VERSION: &str = env!("CARGO_PKG_VERSION");