#[repr(C)]pub struct SnapshotInfo {
pub key: SnapshotImageKey,
pub area: LayoutRect,
pub detached: bool,
}
Expand description
If passed in a stacking context display item, inform WebRender that the contents of the stacking context should be retained into a texture and associated to an image key.
Image display items can then display the cached snapshot using the same image key.
The flow for creating/using/deleting snapshots is the same as with regular images:
- The image key must have been created with
Transaction::add_snapshot_image
. - The current scene must not contain references to the snapshot when
Transaction::delete_snapshot_image
is called.
Fields§
§key: SnapshotImageKey
The image key to associate the snapshot with.
area: LayoutRect
The bounds of the snapshot in local space.
This rectangle is relative to the same coordinate space as the child items of the stacking context.
detached: bool
If true, detach the stacking context from the scene and only render it into the snapshot. If false, the stacking context rendered in the frame normally in addition to being cached into the snapshot.
Trait Implementations§
Source§impl Clone for SnapshotInfo
impl Clone for SnapshotInfo
Source§fn clone(&self) -> SnapshotInfo
fn clone(&self) -> SnapshotInfo
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SnapshotInfo
impl Debug for SnapshotInfo
Source§impl Default for SnapshotInfo
impl Default for SnapshotInfo
Source§fn default() -> SnapshotInfo
fn default() -> SnapshotInfo
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SnapshotInfo
impl<'de> Deserialize<'de> for SnapshotInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for SnapshotInfo
impl PartialEq for SnapshotInfo
Source§impl Peek for SnapshotInfo
impl Peek for SnapshotInfo
Source§impl Poke for SnapshotInfo
impl Poke for SnapshotInfo
Source§impl Serialize for SnapshotInfo
impl Serialize for SnapshotInfo
impl Copy for SnapshotInfo
impl StructuralPartialEq for SnapshotInfo
Auto Trait Implementations§
impl Freeze for SnapshotInfo
impl RefUnwindSafe for SnapshotInfo
impl Send for SnapshotInfo
impl Sync for SnapshotInfo
impl Unpin for SnapshotInfo
impl UnwindSafe for SnapshotInfo
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
Mutably borrows from an owned value. Read more