pub struct Scene {
pub graph: Option<RenderGraph>,
pub hits: Vec<HitRegion>,
pub next_hit_z: usize,
pub node_index: HashMap<usize, usize, RandomState>,
/* private fields */
}Expand description
The retained render graph of a window together with the hit targets built from it.
Fields§
§graph: Option<RenderGraph>The retained render graph, or None before the first build.
hits: Vec<HitRegion>Hit targets in draw order, the last drawn at the end.
next_hit_z: usizeDraw order index that the next pushed hit target receives.
node_index: HashMap<usize, usize, RandomState>Position in hits of the target of each node, for finding a target by node id.
Implementations§
Source§impl Scene
impl Scene
Sourcepub fn diagnostics(&self) -> &RenderDiagnostics
pub fn diagnostics(&self) -> &RenderDiagnostics
The diagnostics shared by the scene and its hit targets.
Sourcepub fn rebuild_from_applier(&mut self, applier: &MemoryApplier, root: usize)
pub fn rebuild_from_applier(&mut self, applier: &MemoryApplier, root: usize)
Rebuilds the retained graph and hit targets from the applier, reusing storage from the previous graph.
Sourcepub fn update_from_applier(
&mut self,
applier: &MemoryApplier,
root: usize,
updates: SceneUpdates<'_>,
refresh_hits: bool,
)
pub fn update_from_applier( &mut self, applier: &MemoryApplier, root: usize, updates: SceneUpdates<'_>, refresh_hits: bool, )
Applies content and layer-property changes to the retained graph.
Empty updates or an unavailable scoped update rebuild the scene.
Hit targets are refreshed when their geometry changes or refresh_hits
is true, as required after layout or pointer-handler changes.
Sourcepub fn push_hit(
&mut self,
node_id: usize,
capture_path: &[usize],
geometry: HitGeometry<'_>,
target: HitTargetSpec<'_>,
)
pub fn push_hit( &mut self, node_id: usize, capture_path: &[usize], geometry: HitGeometry<'_>, target: HitTargetSpec<'_>, )
Adds an interactive target in draw order, ignoring targets that neither handle a pointer nor name a pointer icon.
Sourcepub fn clear_hits(&mut self)
pub fn clear_hits(&mut self)
Removes all hit targets and releases their handlers while retaining vector capacity.
Sourcepub fn replace_graph(&mut self, graph: RenderGraph)
pub fn replace_graph(&mut self, graph: RenderGraph)
Replaces the retained render graph and leaves the hit targets as they are.
Trait Implementations§
Source§impl HitGraphSink for Scene
impl HitGraphSink for Scene
Source§fn push_hit(
&mut self,
node_id: usize,
capture_path: &[usize],
geometry: HitGeometry<'_>,
hit: &HitTestNode,
)
fn push_hit( &mut self, node_id: usize, capture_path: &[usize], geometry: HitGeometry<'_>, hit: &HitTestNode, )
capture_path lists the node first and then its pointer-input
ancestors from the nearest outward, and geometry is in window space.