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
impl LayerRasterCacheKey
Sourcepub fn source_content(
stable_id: Option<NodeId>,
content_hash: u64,
local_bounds: Rect,
pixel_size: (u32, u32),
raster_scale: RasterScale,
device_phase: Point,
) -> Self
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.
Sourcepub fn backdrop_effect(
stable_id: Option<NodeId>,
input_hash: u64,
effect_hash: u64,
local_bounds: Rect,
pixel_size: (u32, u32),
raster_scale: RasterScale,
) -> Self
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.
Sourcepub fn layer_effect(
stable_id: Option<NodeId>,
input_hash: u64,
effect_hash: u64,
local_bounds: Rect,
pixel_size: (u32, u32),
raster_scale: RasterScale,
) -> Self
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.
Sourcepub fn scene_range(
content_hash: u64,
local_bounds: Rect,
pixel_size: (u32, u32),
raster_scale: RasterScale,
) -> Self
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.
Sourcepub fn prefix_snapshot(
content_hash: u64,
prefix_len: u64,
local_bounds: Rect,
pixel_size: (u32, u32),
raster_scale: RasterScale,
) -> Self
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.
Sourcepub fn kind_slot(self) -> usize
pub fn kind_slot(self) -> usize
Index of this key’s kind in 0..LAYER_RASTER_CACHE_KIND_COUNT, for
per-kind accounting.
Sourcepub fn stable_id(self) -> Option<NodeId>
pub fn stable_id(self) -> Option<NodeId>
The node that owns the entry, or None when the entry belongs to no single node.
Sourcepub fn is_scene_range(self) -> bool
pub fn is_scene_range(self) -> bool
Whether the key is for a scene range or a prefix snapshot.
Sourcepub fn is_source_content(self) -> bool
pub fn is_source_content(self) -> bool
Whether the key is for the rasterized content of a layer.
Sourcepub fn identity(self) -> Option<LayerRasterCacheIdentity>
pub fn identity(self) -> Option<LayerRasterCacheIdentity>
The identity of the entry, or None when it has no owning node.
Sourcepub fn pixel_size(self) -> (u32, u32)
pub fn pixel_size(self) -> (u32, u32)
Raster size in pixels as width and height.
Sourcepub fn local_bounds_bits(self) -> [u32; 4]
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.
Sourcepub fn raster_scale(self) -> RasterScale
pub fn raster_scale(self) -> RasterScale
The device scale the raster is drawn at.
Sourcepub fn draws_other_content(self, other: Self) -> bool
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.