Skip to main content

LayerRasterCacheKey

Struct LayerRasterCacheKey 

Source
pub struct LayerRasterCacheKey { /* private fields */ }
Expand description

Key of one cached layer raster. It covers the kind of entry, the owning node, the content and effect hashes, the layer bounds, the pixel size, the raster scale and the sub-pixel phase.

Implementations§

Source§

impl LayerRasterCacheKey

Source

pub fn source_content( stable_id: Option<NodeId>, content_hash: u64, local_bounds: Rect, pixel_size: (u32, u32), raster_scale: RasterScale, device_phase: Point, ) -> Self

Key for the rasterized content of a layer. content_hash hashes the content, local_bounds is the layer’s bounds, pixel_size is the raster size in pixels, and device_phase is the layer’s sub-pixel position, kept in sixteenth-pixel steps.

Source

pub fn backdrop_effect( stable_id: Option<NodeId>, input_hash: u64, effect_hash: u64, local_bounds: Rect, pixel_size: (u32, u32), raster_scale: RasterScale, ) -> Self

Key for the output of a backdrop effect. input_hash hashes the backdrop that the effect reads and effect_hash hashes the effect.

Source

pub fn layer_effect( stable_id: Option<NodeId>, input_hash: u64, effect_hash: u64, local_bounds: Rect, pixel_size: (u32, u32), raster_scale: RasterScale, ) -> Self

A layer’s render effect applied over its retained surface: the output is a pure function of the surface’s content, the effect and the layer’s pixel rect within the surface.

Source

pub fn scene_range( content_hash: u64, local_bounds: Rect, pixel_size: (u32, u32), raster_scale: RasterScale, ) -> Self

Key for a cached range of the scene, identified by the hash of its content and owned by no node.

Source

pub fn prefix_snapshot( content_hash: u64, prefix_len: u64, local_bounds: Rect, pixel_size: (u32, u32), raster_scale: RasterScale, ) -> Self

A snapshot of the scene’s rendered prefix: the bytes the target held after drawing ops [0, prefix_len) over the pass’s clear color. A replay of captured bytes is identical to direct rendering by construction — no flattening, so none of the chained-rounding divergence flatten entries carry.

Source

pub fn kind_slot(self) -> usize

Index of this key’s kind in 0..LAYER_RASTER_CACHE_KIND_COUNT, for per-kind accounting.

Source

pub fn stable_id(self) -> Option<NodeId>

The node that owns the entry, or None when the entry belongs to no single node.

Source

pub fn is_scene_range(self) -> bool

Whether the key is for a scene range or a prefix snapshot.

Source

pub fn is_source_content(self) -> bool

Whether the key is for the rasterized content of a layer.

Source

pub fn identity(self) -> Option<LayerRasterCacheIdentity>

The identity of the entry, or None when it has no owning node.

Source

pub fn pixel_size(self) -> (u32, u32)

Raster size in pixels as width and height.

Source

pub fn local_bounds_bits(self) -> [u32; 4]

The bit pattern of the entry’s local bounds: the place a keyless entry occupies, stable while its content changes.

Source

pub fn raster_scale(self) -> RasterScale

The device scale the raster is drawn at.

Source

pub fn draws_other_content(self, other: Self) -> bool

Whether other rasterizes other content than this key: another kind, node, content, effect or bounds. Keys that differ only in the scale or the sub-pixel phase they are drawn at hold the same content.

Trait Implementations§

Source§

impl Clone for LayerRasterCacheKey

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for LayerRasterCacheKey

Source§

impl Debug for LayerRasterCacheKey

Source§

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

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

impl Eq for LayerRasterCacheKey

Source§

impl Hash for LayerRasterCacheKey

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for LayerRasterCacheKey

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LayerRasterCacheKey

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> ToOwned for T
where T: Clone,

Source§

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>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.