Struct webrender_traits::display_list::ScrollTree

source ·
pub struct ScrollTree {
    pub nodes: Vec<ScrollTreeNode>,
}
Expand description

A tree of spatial nodes, which mirrors the spatial nodes in the WebRender display list, except these are used to scrolling in the compositor so that new offsets can be sent to WebRender.

Fields§

§nodes: Vec<ScrollTreeNode>

A list of compositor-side scroll nodes that describe the tree of WebRender spatial nodes, used by the compositor to scroll the contents of the display list.

Implementations§

source§

impl ScrollTree

source

pub fn add_scroll_tree_node( &mut self, parent: Option<&ScrollTreeNodeId>, spatial_id: SpatialId, scroll_info: Option<ScrollableNodeInfo>, ) -> ScrollTreeNodeId

Add a scroll node to this ScrollTree returning the id of the new node.

source

pub fn get_node_mut(&mut self, id: &ScrollTreeNodeId) -> &mut ScrollTreeNode

Get a mutable reference to the node with the given index.

source

pub fn get_node(&mut self, id: &ScrollTreeNodeId) -> &ScrollTreeNode

Get an immutable reference to the node with the given index.

source

pub fn scroll_node_or_ancestor( &mut self, scroll_node_id: &ScrollTreeNodeId, scroll_location: ScrollLocation, ) -> Option<(ExternalScrollId, LayoutVector2D)>

Scroll the given scroll node on this scroll tree. If the node cannot be scrolled, because it isn’t a scrollable node or it’s already scrolled to the maximum scroll extent, try to scroll an ancestor of this node. Returns the node scrolled and the new offset if a scroll was performed, otherwise returns None.

source

pub fn set_scroll_offsets_for_node_with_external_scroll_id( &mut self, external_scroll_id: ExternalScrollId, offset: LayoutVector2D, ) -> bool

Given an ExternalScrollId and an offset, update the scroll offset of the scroll node with the given id.

Trait Implementations§

source§

impl Debug for ScrollTree

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ScrollTree

source§

fn default() -> ScrollTree

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ScrollTree

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for ScrollTree

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

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<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> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T