pub struct SceneSpatialTree {
    spatial_nodes: Store<SceneSpatialNode>,
    spatial_node_map: FastHashMap<SpatialNodeUid, SpatialNodeEntry>,
    root_reference_frame_index: SpatialNodeIndex,
    frame_counter: u64,
    updates: SpatialTreeUpdates,
    spatial_nodes_set: HashSet<SpatialNodeUid, BuildHasherDefault<FxHasher>>,
}
Expand description

The representation of the spatial tree during scene building, which is mostly write-only, with a small number of queries for snapping, picture cache building

Fields§

§spatial_nodes: Store<SceneSpatialNode>

Nodes which determine the positions (offsets and transforms) for primitives and clips.

§spatial_node_map: FastHashMap<SpatialNodeUid, SpatialNodeEntry>

A set of the uids we’ve encountered for spatial nodes, used to assert that we’re not seeing duplicates. Likely to be removed once we rely on this feature.

§root_reference_frame_index: SpatialNodeIndex§frame_counter: u64§updates: SpatialTreeUpdates§spatial_nodes_set: HashSet<SpatialNodeUid, BuildHasherDefault<FxHasher>>

A debug check that the caller never adds a spatial node with duplicate uid, since that can cause badness if it occurs (e.g. a malformed spatial tree and infinite loops in is_ancestor etc)

Implementations§

source§

impl SceneSpatialTree

source

pub fn new() -> Self

source

pub fn is_root_coord_system(&self, index: SpatialNodeIndex) -> bool

source

pub fn end_frame_and_get_pending_updates(&mut self) -> SpatialTreeUpdates

Complete building this scene, return the updates to apply to the frame spatial tree

source

pub fn is_ancestor( &self, maybe_parent: SpatialNodeIndex, maybe_child: SpatialNodeIndex ) -> bool

Check if a given spatial node is an ancestor of another spatial node.

source

pub fn find_scroll_root( &self, spatial_node_index: SpatialNodeIndex ) -> SpatialNodeIndex

Find the spatial node that is the scroll root for a given spatial node. A scroll root is the first spatial node when found travelling up the spatial node tree that is an explicit scroll frame.

source

pub fn root_reference_frame_index(&self) -> SpatialNodeIndex

The root reference frame, which is the true root of the SpatialTree.

source

fn add_spatial_node( &mut self, node: SceneSpatialNode, uid: SpatialNodeUid ) -> SpatialNodeIndex

source

pub fn add_reference_frame( &mut self, parent_index: SpatialNodeIndex, transform_style: TransformStyle, source_transform: PropertyBinding<LayoutTransform>, kind: ReferenceFrameKind, origin_in_parent_reference_frame: LayoutVector2D, pipeline_id: PipelineId, uid: SpatialNodeUid ) -> SpatialNodeIndex

source

pub fn add_scroll_frame( &mut self, parent_index: SpatialNodeIndex, external_id: ExternalScrollId, pipeline_id: PipelineId, frame_rect: &LayoutRect, content_size: &LayoutSize, frame_kind: ScrollFrameKind, external_scroll_offset: LayoutVector2D, scroll_offset_generation: APZScrollGeneration, has_scroll_linked_effect: HasScrollLinkedEffect, uid: SpatialNodeUid ) -> SpatialNodeIndex

source

pub fn add_sticky_frame( &mut self, parent_index: SpatialNodeIndex, sticky_frame_info: StickyFrameInfo, pipeline_id: PipelineId, key: SpatialTreeItemKey, instance_id: PipelineInstanceId ) -> SpatialNodeIndex

Trait Implementations§

source§

impl Serialize for SceneSpatialTree

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SpatialNodeContainer for SceneSpatialTree

source§

fn get_node_info(&self, index: SpatialNodeIndex) -> SpatialNodeInfo<'_>

Get the common information for a given spatial node

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.