Struct webrender_api::ReferenceFrameMapper
source · pub struct ReferenceFrameMapper {
frames: Vec<ReferenceFrameState>,
}
Expand description
Maps from stacking context layout coordinates into reference frame relative coordinates.
Fields§
§frames: Vec<ReferenceFrameState>
A stack of reference frame scopes.
Implementations§
source§impl ReferenceFrameMapper
impl ReferenceFrameMapper
pub fn new() -> Self
sourcepub fn push_scope(&mut self)
pub fn push_scope(&mut self)
Push a new scope. This resets the current offset to zero, and is used when a new reference frame or iframe is pushed.
sourcepub fn push_offset(&mut self, offset: LayoutVector2D)
pub fn push_offset(&mut self, offset: LayoutVector2D)
Push a new offset for the current scope. This is used when a new stacking context is pushed.
sourcepub fn pop_offset(&mut self)
pub fn pop_offset(&mut self)
Pop a local stacking context offset from the current scope.
sourcepub fn current_offset(&self) -> LayoutVector2D
pub fn current_offset(&self) -> LayoutVector2D
Retrieve the current offset to allow converting a stacking context relative coordinate to be relative to the owing reference frame. TODO(gw): We could perhaps have separate coordinate spaces for this, however that’s going to either mean a lot of changes to public API code, or a lot of changes to internal code. Before doing that, we should revisit how Gecko would prefer to provide coordinates. TODO(gw): For now, this includes only the reference frame relative offset. Soon, we will expand this to include the initial scroll offsets that are now available on scroll nodes. This will allow normalizing the coordinates even between display lists where APZ has scrolled the content.
Trait Implementations§
source§impl Clone for ReferenceFrameMapper
impl Clone for ReferenceFrameMapper
source§fn clone(&self) -> ReferenceFrameMapper
fn clone(&self) -> ReferenceFrameMapper
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for ReferenceFrameMapper
impl RefUnwindSafe for ReferenceFrameMapper
impl Send for ReferenceFrameMapper
impl Sync for ReferenceFrameMapper
impl Unpin for ReferenceFrameMapper
impl UnwindSafe for ReferenceFrameMapper
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)