pub struct LayoutEngine { /* private fields */ }Expand description
Deterministic cross-platform Flexbox, Grid, Block, and Positioned layout engine.
Implementations§
Source§impl LayoutEngine
Core layout solver, split cache management, and spatial hit-testing operations for LayoutEngine.
impl LayoutEngine
Core layout solver, split cache management, and spatial hit-testing operations for LayoutEngine.
Sourcepub fn compute(&mut self, tree: &mut SceneTree, viewport: Size) -> LayoutStats
pub fn compute(&mut self, tree: &mut SceneTree, viewport: Size) -> LayoutStats
Sourcepub fn compute_serial(
&mut self,
tree: &mut SceneTree,
viewport: Size,
) -> LayoutStats
pub fn compute_serial( &mut self, tree: &mut SceneTree, viewport: Size, ) -> LayoutStats
Sourcepub fn compute_parallel(
&mut self,
tree: &mut SceneTree,
viewport: Size,
) -> LayoutStats
pub fn compute_parallel( &mut self, tree: &mut SceneTree, viewport: Size, ) -> LayoutStats
Sourcepub fn set_parallel_enabled(&mut self, enabled: bool)
pub fn set_parallel_enabled(&mut self, enabled: bool)
Enables or disables automatic parallel CPU layout dispatch inside compute.
§Arguments
bool-trueto enable automatic parallel dispatch above tree thresholds,falseto force serial traversal.
Sourcepub fn is_parallel_enabled(&self) -> bool
pub fn is_parallel_enabled(&self) -> bool
Returns whether automatic parallel CPU layout dispatch is enabled inside compute.
§Returns
bool:truewhen parallel CPU layout dispatch is enabled.
Sourcepub fn sync_layout_soa(&mut self, tree: &SceneTree) -> &SceneLayoutSoa
pub fn sync_layout_soa(&mut self, tree: &SceneTree) -> &SceneLayoutSoa
Sourcepub fn layout_soa(&self) -> &SceneLayoutSoa
pub fn layout_soa(&self) -> &SceneLayoutSoa
Returns a shared reference to the cached SceneLayoutSoa snapshot.
§Returns
&SceneLayoutSoa: Cached dense layout SoA reference.
Sourcepub fn layout_soa_mut(&mut self) -> &mut SceneLayoutSoa
pub fn layout_soa_mut(&mut self) -> &mut SceneLayoutSoa
Returns a mutable reference to the cached SceneLayoutSoa snapshot.
§Returns
&mut SceneLayoutSoa: Mutable cached dense layout SoA reference.
Sourcepub fn last_parallel_stats(&self) -> ParallelLayoutStats
pub fn last_parallel_stats(&self) -> ParallelLayoutStats
Returns per-pass parallel dispatch and SIMD acceleration diagnostics from the most recent parallel layout pass.
§Returns
ParallelLayoutStats: Last parallel layout pass diagnostics.
Sourcepub fn layout_telemetry(&self) -> LayoutTelemetry
pub fn layout_telemetry(&self) -> LayoutTelemetry
Sourcepub fn reset_telemetry(&mut self)
pub fn reset_telemetry(&mut self)
Sourcepub fn split_cache_stats(&self) -> SplitCacheStats
pub fn split_cache_stats(&self) -> SplitCacheStats
Sourcepub fn subtree_bounds(&self, node_id: NodeId) -> Option<Rect>
pub fn subtree_bounds(&self, node_id: NodeId) -> Option<Rect>
Sourcepub fn hit_test(&self, tree: &SceneTree, point: Point) -> Option<NodeId>
pub fn hit_test(&self, tree: &SceneTree, point: Point) -> Option<NodeId>
Performs zero-allocation spatial hit-testing accelerated by cached subtree_bounds and has_nonzero_z_child.
§Arguments
&Self- Layout engine reference owning the spatial cache.&SceneTree- Retained scene tree after layout.Point- Logical pointer coordinates in root space.
§Returns
Option<NodeId>- Topmost matching node handle, if any.
Sourcepub fn hit_test_with_visited(
&self,
tree: &SceneTree,
point: Point,
) -> (Option<NodeId>, usize)
pub fn hit_test_with_visited( &self, tree: &SceneTree, point: Point, ) -> (Option<NodeId>, usize)
Performs zero-allocation spatial hit-testing and also returns the number of inspected scene nodes.
§Arguments
&Self- Layout engine reference owning the spatial cache.&SceneTree- Retained scene tree after layout.Point- Logical pointer coordinates in root space.
§Returns
(Option<NodeId>, usize)- Pair of(topmost_hit, nodes_visited).
Source§impl LayoutEngine
Implements impl #impl_generics #name #ty_generics #where_clause.
impl LayoutEngine
Implements impl #impl_generics #name #ty_generics #where_clause.