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
impl ScrollFrameInfo
Manages scrolling offset.
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
pub fn offset(&self) -> LayoutVector2D
Trait Implementations§
source§impl Clone for ScrollFrameInfo
impl Clone for ScrollFrameInfo
source§fn clone(&self) -> ScrollFrameInfo
fn clone(&self) -> ScrollFrameInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScrollFrameInfo
impl Debug for ScrollFrameInfo
source§impl PartialEq for ScrollFrameInfo
impl PartialEq for ScrollFrameInfo
source§fn eq(&self, other: &ScrollFrameInfo) -> bool
fn eq(&self, other: &ScrollFrameInfo) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ScrollFrameInfo
impl Serialize for ScrollFrameInfo
impl StructuralPartialEq for ScrollFrameInfo
Auto Trait Implementations§
impl Freeze for ScrollFrameInfo
impl RefUnwindSafe for ScrollFrameInfo
impl Send for ScrollFrameInfo
impl Sync for ScrollFrameInfo
impl Unpin for ScrollFrameInfo
impl UnwindSafe for ScrollFrameInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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