pub struct RuntimeContext {
pub layer_count: Cell<usize>,
pub dirty_canvases: Rc<RefCell<Vec<bool>>>,
/* private fields */
}Expand description
Shared context for properties pass recursion
Fields§
§layer_count: Cell<usize>§dirty_canvases: Rc<RefCell<Vec<bool>>>Implementations§
Source§impl RuntimeContext
impl RuntimeContext
Sourcepub fn register_root_expanded_node(&self, root: &Rc<ExpandedNode>)
pub fn register_root_expanded_node(&self, root: &Rc<ExpandedNode>)
Store the root expanded node after it has been initialized.
Sourcepub fn clear_root_expanded_node(&self)
pub fn clear_root_expanded_node(&self)
Clear the registered root expanded node.
Sourcepub fn add_to_cache(&self, node: &Rc<ExpandedNode>)
pub fn add_to_cache(&self, node: &Rc<ExpandedNode>)
Add a node to runtime lookup caches.
Sourcepub fn remove_from_cache(&self, node: &Rc<ExpandedNode>)
pub fn remove_from_cache(&self, node: &Rc<ExpandedNode>)
Remove a node from runtime lookup caches.
pub fn has_import_settings_nodes(&self) -> bool
pub fn register_node_effect_property( &self, node: ExpandedNodeIdentifier, prop: &Property<()>, )
pub fn register_node_effect_property_named( &self, node: ExpandedNodeIdentifier, prop: &Property<()>, effect_name: &str, )
pub fn register_expanded_node_effect_property_named( &self, node: &Rc<ExpandedNode>, prop: &Property<()>, effect_name: &str, )
pub fn register_node_effect( &self, node: ExpandedNodeIdentifier, dependencies: &[UntypedProperty], effect: impl Fn() + 'static, ) -> Property<()>
pub fn drain_node_effects(&self)
pub fn tick_handler_nodes(&self) -> Vec<ExpandedNodeIdentifier>
pub fn pre_render_handler_nodes(&self) -> Vec<ExpandedNodeIdentifier>
pub fn gyro_handler_nodes(&self) -> Vec<ExpandedNodeIdentifier>
pub fn accel_handler_nodes(&self) -> Vec<ExpandedNodeIdentifier>
Sourcepub fn get_expanded_node_by_eid(
&self,
id: ExpandedNodeIdentifier,
) -> Option<Rc<ExpandedNode>>
pub fn get_expanded_node_by_eid( &self, id: ExpandedNodeIdentifier, ) -> Option<Rc<ExpandedNode>>
Look up an expanded node by runtime id.
Sourcepub fn capture_touch_target(
&self,
identifier: i64,
target: ExpandedNodeIdentifier,
)
pub fn capture_touch_target( &self, identifier: i64, target: ExpandedNodeIdentifier, )
Route a touch sequence to the node hit at touch-down, even after the finger moves away.
Sourcepub fn captured_touch_target(&self, identifier: i64) -> Option<Rc<ExpandedNode>>
pub fn captured_touch_target(&self, identifier: i64) -> Option<Rc<ExpandedNode>>
Resolve the node captured for an active touch sequence.
Sourcepub fn release_touch_target(&self, identifier: i64) -> Option<Rc<ExpandedNode>>
pub fn release_touch_target(&self, identifier: i64) -> Option<Rc<ExpandedNode>>
Release and resolve the node captured for a completed touch sequence.
Sourcepub fn load_screenshot(&self, id: u32, data: ScreenshotData) -> bool
pub fn load_screenshot(&self, id: u32, data: ScreenshotData) -> bool
Store a screenshot payload delivered by the chassis.
Sourcepub fn get_screenshot_map(&self) -> Rc<RefCell<HashMap<u32, ScreenshotData>>>
pub fn get_screenshot_map(&self) -> Rc<RefCell<HashMap<u32, ScreenshotData>>>
Shared screenshot capture map keyed by request id.
Sourcepub fn set_scroller_surface_state(
&self,
id: u32,
state: ScrollerSurfaceState,
) -> ScrollerSurfaceStateChange
pub fn set_scroller_surface_state( &self, id: u32, state: ScrollerSurfaceState, ) -> ScrollerSurfaceStateChange
Remember browser-owned scroller state for native compositing and scroll transforms.
Sourcepub fn update_scroller_surface_scroll(
&self,
id: u32,
scroll_x: f64,
scroll_y: f64,
presentation_scroll_x: f64,
presentation_scroll_y: f64,
) -> ScrollerSurfaceStateChange
pub fn update_scroller_surface_scroll( &self, id: u32, scroll_x: f64, scroll_y: f64, presentation_scroll_x: f64, presentation_scroll_y: f64, ) -> ScrollerSurfaceStateChange
Update hot scroll offsets for an existing native scroller surface without touching structural state.
Sourcepub fn remove_scroller_surface_state(&self, id: u32)
pub fn remove_scroller_surface_state(&self, id: u32)
Remove cached scroller surface state.
Sourcepub fn get_scroller_surface_state(
&self,
id: u32,
) -> Option<ScrollerSurfaceState>
pub fn get_scroller_surface_state( &self, id: u32, ) -> Option<ScrollerSurfaceState>
Fetch cached scroller surface state by node id.
Sourcepub fn get_scroller_surface_scroll(&self, id: u32) -> Option<(f64, f64)>
pub fn get_scroller_surface_scroll(&self, id: u32) -> Option<(f64, f64)>
Fetch the presentation scroll offset for a native scroller surface, falling back to the authoritative scroll position when presentation scroll is unavailable.
Sourcepub fn clear_layer_scroller_owners(&self)
pub fn clear_layer_scroller_owners(&self)
Clear render-layer-to-scroller ownership before recomputing occlusion.
Sourcepub fn register_layer_scroller_owner(
&self,
layer_id: usize,
scroller_id: ExpandedNodeIdentifier,
)
pub fn register_layer_scroller_owner( &self, layer_id: usize, scroller_id: ExpandedNodeIdentifier, )
Record that a render layer is owned by a particular scroller.
Sourcepub fn get_layer_scroller_owner(
&self,
layer_id: usize,
) -> Option<ExpandedNodeIdentifier>
pub fn get_layer_scroller_owner( &self, layer_id: usize, ) -> Option<ExpandedNodeIdentifier>
Find the scroller that owns a render layer, when one exists.
Sourcepub fn set_root_scroller_id(&self, id: Option<u32>)
pub fn set_root_scroller_id(&self, id: Option<u32>)
Mark which node currently delegates root scrolling behavior to the page.
Sourcepub fn get_root_scroller_id(&self) -> Option<u32>
pub fn get_root_scroller_id(&self) -> Option<u32>
Current page-scroll-backed root scroller id.
Sourcepub fn set_visual_viewport_state(&self, state: VisualViewportState)
pub fn set_visual_viewport_state(&self, state: VisualViewportState)
Cache the browser visual viewport state for root scroller math.
Sourcepub fn clear_visual_viewport_state(&self)
pub fn clear_visual_viewport_state(&self)
Clear cached visual viewport state.
Sourcepub fn get_visual_viewport_state(&self) -> Option<VisualViewportState>
pub fn get_visual_viewport_state(&self) -> Option<VisualViewportState>
Return cached browser visual viewport state, if available.
Sourcepub fn resize_canvas_layers_to(&self, id: usize)
pub fn resize_canvas_layers_to(&self, id: usize)
Ensure the dirty-canvas table has entries up to the requested layer count.
pub fn mark_layer_canvas_plans_dirty(&self)
pub fn layer_canvas_plan_generation(&self) -> u32
Sourcepub fn set_canvas_drawable_layers(&self, layers: HashSet<usize>)
pub fn set_canvas_drawable_layers(&self, layers: HashSet<usize>)
Replace the set of render layers that currently contain canvas drawables.
Sourcepub fn layer_has_canvas_drawables(&self, layer: usize) -> bool
pub fn layer_has_canvas_drawables(&self, layer: usize) -> bool
Return whether a render layer currently has canvas work to paint.
Sourcepub fn clear_all_dirty_canvases(&self)
pub fn clear_all_dirty_canvases(&self)
Mark every canvas layer clean.
Sourcepub fn set_canvas_dirty(&self, id: usize)
pub fn set_canvas_dirty(&self, id: usize)
Mark a canvas layer dirty.
Sourcepub fn is_canvas_dirty(&self, id: &usize) -> bool
pub fn is_canvas_dirty(&self, id: &usize) -> bool
Check whether a canvas layer needs redraw.
pub fn dirty_canvas_layers(&self) -> Vec<usize>
pub fn has_dirty_canvas_layers(&self) -> bool
pub fn has_dirty_canvas_nodes(&self) -> bool
pub fn has_canvas_node_removals(&self) -> bool
pub fn has_canvas_render_work(&self) -> bool
pub fn mark_occlusion_dirty(&self)
pub fn take_occlusion_dirty(&self) -> bool
pub fn set_all_canvases_dirty(&self)
pub fn mark_canvas_node_dirty(&self, id: ExpandedNodeIdentifier)
pub fn clear_canvas_node_dirty(&self, id: &ExpandedNodeIdentifier)
pub fn is_canvas_node_dirty(&self, id: &ExpandedNodeIdentifier) -> bool
pub fn dirty_canvas_node_ids(&self) -> Vec<ExpandedNodeIdentifier>
pub fn mark_canvas_nodes_on_layer_dirty(&self, layer: usize)
Sourcepub fn canvas_node_light_mask(&self, id: ExpandedNodeIdentifier) -> u32
pub fn canvas_node_light_mask(&self, id: ExpandedNodeIdentifier) -> u32
Return the direct-light membership mask resolved for a retained canvas node.
pub fn collect_scene_lighting_for_layer(&self, layer: usize) -> SceneLighting
pub fn mark_canvas_nodes_on_layer_dirty_by_id( &self, layer: usize, node_ids: &[u32], )
pub fn mark_targeted_canvas_replay_nodes(&self, layer: usize, node_ids: &[u32])
pub fn take_targeted_canvas_replay_node_ids( &self, ) -> HashMap<usize, HashSet<u32>>
pub fn mark_all_canvas_nodes_dirty(&self)
pub fn enqueue_canvas_node_removal(&self, layer: usize, node_id: u32)
pub fn take_canvas_node_removals(&self) -> Vec<(usize, u32)>
Sourcepub fn get_expanded_nodes_by_id(&self, id: &str) -> Vec<Rc<ExpandedNode>>
pub fn get_expanded_nodes_by_id(&self, id: &str) -> Vec<Rc<ExpandedNode>>
Finds all ExpandedNodes with the CommonProperty#id matching the provided string
Sourcepub fn get_expanded_nodes_by_global_ids(
&self,
uni: &UniqueTemplateNodeIdentifier,
) -> Vec<Rc<ExpandedNode>>
pub fn get_expanded_nodes_by_global_ids( &self, uni: &UniqueTemplateNodeIdentifier, ) -> Vec<Rc<ExpandedNode>>
Finds all ExpandedNodes with corresponding UniqueTemplateNodeIdentifier
Sourcepub fn get_elements_beneath_ray(
&self,
root: Option<Rc<ExpandedNode>>,
ray: Point2<Window>,
limit_one: bool,
accum: Vec<Rc<ExpandedNode>>,
hit_invisible: bool,
) -> Vec<Rc<ExpandedNode>>
pub fn get_elements_beneath_ray( &self, root: Option<Rc<ExpandedNode>>, ray: Point2<Window>, limit_one: bool, accum: Vec<Rc<ExpandedNode>>, hit_invisible: bool, ) -> Vec<Rc<ExpandedNode>>
Simple 2D raycasting: the coordinates of the ray represent a
ray running orthogonally to the view plane, intersecting at
the specified point ray. Areas outside of clipping bounds will
not register a hit, nor will elements that suppress input events.
Sourcepub fn get_topmost_element_beneath_ray(
self: &Rc<Self>,
ray: Point2<Window>,
) -> Option<Rc<ExpandedNode>>
pub fn get_topmost_element_beneath_ray( self: &Rc<Self>, ray: Point2<Window>, ) -> Option<Rc<ExpandedNode>>
Alias for get_elements_beneath_ray with limit_one = true