Struct webrender::spatial_node::ScrollFrameInfo

source ·
pub struct ScrollFrameInfo {
    pub viewport_rect: LayoutRect,
    pub scrollable_size: LayoutSize,
    pub external_id: ExternalScrollId,
    pub frame_kind: ScrollFrameKind,
    pub external_scroll_offset: LayoutVector2D,
    pub offsets: Vec<SampledScrollOffset>,
    pub offset_generation: APZScrollGeneration,
    pub has_scroll_linked_effect: HasScrollLinkedEffect,
}

Fields§

§viewport_rect: LayoutRect

The rectangle of the viewport of this scroll frame. This is important for positioning of items inside child StickyFrames.

§scrollable_size: LayoutSize

Amount that this ScrollFrame can scroll in both directions.

§external_id: ExternalScrollId

An external id to identify this scroll frame to API clients. This allows setting scroll positions via the API without relying on ClipsIds which may change between frames.

§frame_kind: ScrollFrameKind

Stores whether this is a scroll frame added implicitly by WR when adding a pipeline (either the root or an iframe). We need to exclude these when searching for scroll roots we care about for picture caching. TODO(gw): I think we can actually completely remove the implicit scroll frame being added by WR, and rely on the embedder to define scroll frames. However, that involves API changes so we will use this as a temporary hack!

§external_scroll_offset: LayoutVector2D

Amount that visual components attached to this scroll node have been pre-scrolled in their local coordinates.

§offsets: Vec<SampledScrollOffset>

A set of a pair of negated scroll offset and scroll generation of this scroll node. The negated scroll offset is including the pre-scrolled amount. If, for example, a scroll node was pre-scrolled to y=10 (10 pixels down from the initial unscrolled position), then external_scroll_offset would be (0,10), and this offset field would be (0,-10). If WebRender is then asked to change the scroll position by an additional 10 pixels (without changing the pre-scroll amount in the display list), external_scroll_offset would remain at (0,10) and offset would change to (0,-20).

§offset_generation: APZScrollGeneration

The generation of the external_scroll_offset. This is used to pick up the most appropriate scroll offset sampled off the main thread.

§has_scroll_linked_effect: HasScrollLinkedEffect

Whether the document containing this scroll frame has any scroll-linked effect or not.

Implementations§

source§

impl ScrollFrameInfo

Manages scrolling offset.

source

pub fn new( viewport_rect: LayoutRect, scrollable_size: LayoutSize, external_id: ExternalScrollId, frame_kind: ScrollFrameKind, external_scroll_offset: LayoutVector2D, offset_generation: APZScrollGeneration, has_scroll_linked_effect: HasScrollLinkedEffect, ) -> ScrollFrameInfo

source

pub fn offset(&self) -> LayoutVector2D

Trait Implementations§

source§

impl Clone for ScrollFrameInfo

source§

fn clone(&self) -> ScrollFrameInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ScrollFrameInfo

source§

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

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

impl PartialEq for ScrollFrameInfo

source§

fn eq(&self, other: &ScrollFrameInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ScrollFrameInfo

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 StructuralPartialEq for ScrollFrameInfo

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> 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.