Skip to main content

RuntimeContext

Struct RuntimeContext 

Source
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

Source

pub fn new(globals: Globals) -> Self

Create a runtime context for normal app execution.

Source

pub fn register_root_expanded_node(&self, root: &Rc<ExpandedNode>)

Store the root expanded node after it has been initialized.

Source

pub fn clear_root_expanded_node(&self)

Clear the registered root expanded node.

Source

pub fn add_to_cache(&self, node: &Rc<ExpandedNode>)

Add a node to runtime lookup caches.

Source

pub fn remove_from_cache(&self, node: &Rc<ExpandedNode>)

Remove a node from runtime lookup caches.

Source

pub fn has_import_settings_nodes(&self) -> bool

Source

pub fn register_node_effect_property( &self, node: ExpandedNodeIdentifier, prop: &Property<()>, )

Source

pub fn register_node_effect_property_named( &self, node: ExpandedNodeIdentifier, prop: &Property<()>, effect_name: &str, )

Source

pub fn register_expanded_node_effect_property_named( &self, node: &Rc<ExpandedNode>, prop: &Property<()>, effect_name: &str, )

Source

pub fn register_node_effect( &self, node: ExpandedNodeIdentifier, dependencies: &[UntypedProperty], effect: impl Fn() + 'static, ) -> Property<()>

Source

pub fn drain_node_effects(&self)

Source

pub fn tick_handler_nodes(&self) -> Vec<ExpandedNodeIdentifier>

Source

pub fn pre_render_handler_nodes(&self) -> Vec<ExpandedNodeIdentifier>

Source

pub fn gyro_handler_nodes(&self) -> Vec<ExpandedNodeIdentifier>

Source

pub fn accel_handler_nodes(&self) -> Vec<ExpandedNodeIdentifier>

Source

pub fn get_expanded_node_by_eid( &self, id: ExpandedNodeIdentifier, ) -> Option<Rc<ExpandedNode>>

Look up an expanded node by runtime id.

Source

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.

Source

pub fn captured_touch_target(&self, identifier: i64) -> Option<Rc<ExpandedNode>>

Resolve the node captured for an active touch sequence.

Source

pub fn release_touch_target(&self, identifier: i64) -> Option<Rc<ExpandedNode>>

Release and resolve the node captured for a completed touch sequence.

Source

pub fn load_screenshot(&self, id: u32, data: ScreenshotData) -> bool

Store a screenshot payload delivered by the chassis.

Source

pub fn get_screenshot_map(&self) -> Rc<RefCell<HashMap<u32, ScreenshotData>>>

Shared screenshot capture map keyed by request id.

Source

pub fn set_scroller_surface_state( &self, id: u32, state: ScrollerSurfaceState, ) -> ScrollerSurfaceStateChange

Remember browser-owned scroller state for native compositing and scroll transforms.

Source

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.

Source

pub fn remove_scroller_surface_state(&self, id: u32)

Remove cached scroller surface state.

Source

pub fn get_scroller_surface_state( &self, id: u32, ) -> Option<ScrollerSurfaceState>

Fetch cached scroller surface state by node id.

Source

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.

Source

pub fn clear_layer_scroller_owners(&self)

Clear render-layer-to-scroller ownership before recomputing occlusion.

Source

pub fn register_layer_scroller_owner( &self, layer_id: usize, scroller_id: ExpandedNodeIdentifier, )

Record that a render layer is owned by a particular scroller.

Source

pub fn get_layer_scroller_owner( &self, layer_id: usize, ) -> Option<ExpandedNodeIdentifier>

Find the scroller that owns a render layer, when one exists.

Source

pub fn set_root_scroller_id(&self, id: Option<u32>)

Mark which node currently delegates root scrolling behavior to the page.

Source

pub fn get_root_scroller_id(&self) -> Option<u32>

Current page-scroll-backed root scroller id.

Source

pub fn set_visual_viewport_state(&self, state: VisualViewportState)

Cache the browser visual viewport state for root scroller math.

Source

pub fn clear_visual_viewport_state(&self)

Clear cached visual viewport state.

Source

pub fn get_visual_viewport_state(&self) -> Option<VisualViewportState>

Return cached browser visual viewport state, if available.

Source

pub fn resize_canvas_layers_to(&self, id: usize)

Ensure the dirty-canvas table has entries up to the requested layer count.

Source

pub fn mark_layer_canvas_plans_dirty(&self)

Source

pub fn layer_canvas_plan_generation(&self) -> u32

Source

pub fn set_canvas_drawable_layers(&self, layers: HashSet<usize>)

Replace the set of render layers that currently contain canvas drawables.

Source

pub fn layer_has_canvas_drawables(&self, layer: usize) -> bool

Return whether a render layer currently has canvas work to paint.

Source

pub fn clear_all_dirty_canvases(&self)

Mark every canvas layer clean.

Source

pub fn set_canvas_dirty(&self, id: usize)

Mark a canvas layer dirty.

Source

pub fn is_canvas_dirty(&self, id: &usize) -> bool

Check whether a canvas layer needs redraw.

Source

pub fn dirty_canvas_layers(&self) -> Vec<usize>

Source

pub fn has_dirty_canvas_layers(&self) -> bool

Source

pub fn has_dirty_canvas_nodes(&self) -> bool

Source

pub fn has_canvas_node_removals(&self) -> bool

Source

pub fn has_canvas_render_work(&self) -> bool

Source

pub fn mark_occlusion_dirty(&self)

Source

pub fn take_occlusion_dirty(&self) -> bool

Source

pub fn set_all_canvases_dirty(&self)

Source

pub fn mark_canvas_node_dirty(&self, id: ExpandedNodeIdentifier)

Source

pub fn clear_canvas_node_dirty(&self, id: &ExpandedNodeIdentifier)

Source

pub fn is_canvas_node_dirty(&self, id: &ExpandedNodeIdentifier) -> bool

Source

pub fn dirty_canvas_node_ids(&self) -> Vec<ExpandedNodeIdentifier>

Source

pub fn mark_canvas_nodes_on_layer_dirty(&self, layer: usize)

Source

pub fn canvas_node_light_mask(&self, id: ExpandedNodeIdentifier) -> u32

Return the direct-light membership mask resolved for a retained canvas node.

Source

pub fn collect_scene_lighting_for_layer(&self, layer: usize) -> SceneLighting

Source

pub fn mark_canvas_nodes_on_layer_dirty_by_id( &self, layer: usize, node_ids: &[u32], )

Source

pub fn mark_targeted_canvas_replay_nodes(&self, layer: usize, node_ids: &[u32])

Source

pub fn take_targeted_canvas_replay_node_ids( &self, ) -> HashMap<usize, HashSet<u32>>

Source

pub fn mark_all_canvas_nodes_dirty(&self)

Source

pub fn enqueue_canvas_node_removal(&self, layer: usize, node_id: u32)

Source

pub fn take_canvas_node_removals(&self) -> Vec<(usize, u32)>

Source

pub fn get_expanded_nodes_by_id(&self, id: &str) -> Vec<Rc<ExpandedNode>>

Finds all ExpandedNodes with the CommonProperty#id matching the provided string

Source

pub fn get_expanded_nodes_by_global_ids( &self, uni: &UniqueTemplateNodeIdentifier, ) -> Vec<Rc<ExpandedNode>>

Finds all ExpandedNodes with corresponding UniqueTemplateNodeIdentifier

Source

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.

Source

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

Source

pub fn gen_uid(&self) -> ExpandedNodeIdentifier

Source

pub fn enqueue_native_message(&self, message: NativeMessage)

Source

pub fn take_native_messages(&self) -> Vec<NativeMessage>

Source

pub fn globals(&self) -> Globals

Source

pub fn edit_globals(&self, f: impl Fn(&mut Globals))

Source

pub fn queue_custom_event( &self, source_expanded_node: Rc<ExpandedNode>, name: &'static str, )

Source

pub fn flush_custom_events(self: &Rc<Self>) -> Result<(), String>

Source

pub fn get_root_expanded_node(&self) -> Option<Rc<ExpandedNode>>

Source

pub fn queue_render(&self, expanded_node: Rc<ExpandedNode>)

Source

pub fn recurse_flush_queued_renders( self: &Rc<RuntimeContext>, rcs: &mut dyn RenderContext, )

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> RoundFrom<T> for T

Source§

fn round_from(x: T) -> T

Performs the conversion.
Source§

impl<T, U> RoundInto<U> for T
where U: RoundFrom<T>,

Source§

fn round_into(self) -> U

Performs the conversion.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>