pub struct LayerRef<'a> { /* private fields */ }Expand description
One record of a SceneStore: a layer, a wrapper, a draw group or a
leaf drawn in its parent’s layer.
Implementations§
Source§impl<'a> LayerRef<'a>
impl<'a> LayerRef<'a>
Sourcepub fn store(self) -> &'a SceneStore
pub fn store(self) -> &'a SceneStore
The store that holds the record.
Sourcepub fn kind(self) -> RecordKind
pub fn kind(self) -> RecordKind
What the record draws for.
Sourcepub fn node_id(self) -> Option<NodeId>
pub fn node_id(self) -> Option<NodeId>
The layout node of a node’s layer or leaf; None for a wrapper, a
draw group and an overlay.
Sourcepub fn identity(self) -> (Option<NodeId>, Option<NodeId>)
pub fn identity(self) -> (Option<NodeId>, Option<NodeId>)
Self::node_id and Self::wraps from one read of the record.
Sourcepub fn props(self) -> Option<&'a LayerProps>
pub fn props(self) -> Option<&'a LayerProps>
The properties the record keeps beyond its fixed-size parts.
Sourcepub fn flags(self) -> RecordFlags
pub fn flags(self) -> RecordFlags
The record’s flags.
Sourcepub fn local_bounds(self) -> Rect
pub fn local_bounds(self) -> Rect
The bounds of the layer, where its clip cuts, its transforms pivot and an offscreen pass draws it.
Sourcepub fn node_bounds(self) -> Option<Rect>
pub fn node_bounds(self) -> Option<Rect>
The node’s rect when it differs from Self::local_bounds.
Sourcepub fn origin(self) -> Point
pub fn origin(self) -> Point
The record’s top left in its parent’s layer: its placement and the parent’s content offset. A leaf’s transform moves it there.
Sourcepub fn transform_to_parent(self) -> ProjectiveTransform
pub fn transform_to_parent(self) -> ProjectiveTransform
Maps the record’s space to its parent’s content space, with the placement, the graphics layer transform and the parent’s content offset applied.
Sourcepub fn placement(self) -> Placement
pub fn placement(self) -> Placement
Where the record sits in its parent’s layer: Self::transform_to_parent
without making a transform of a point.
Sourcepub fn content_offset(self) -> Point
pub fn content_offset(self) -> Point
Offset of the node’s content box from its origin, where its children are placed.
Sourcepub fn origin_in_parent(self) -> Point
pub fn origin_in_parent(self) -> Point
Where layout placed the record within its parent’s content, before the parent’s content offset.
Sourcepub fn motion_context_animated(self) -> bool
pub fn motion_context_animated(self) -> bool
Whether the record lies in a motion context such as an animated scroll, where a renderer must not snap its content rigidly to the pixel grid.
Sourcepub fn translated_content_context(self) -> bool
pub fn translated_content_context(self) -> bool
Whether the record moves its content as one translated block, so a renderer may snap that content to the pixel grid as a whole.
Sourcepub fn translated_content_offset(self) -> Point
pub fn translated_content_offset(self) -> Point
Translation of the content in a translated content context.
Sourcepub fn graphics_layer(self) -> &'a GraphicsLayer
pub fn graphics_layer(self) -> &'a GraphicsLayer
The graphics layer properties; defaults when none were set.
Sourcepub fn clip_to_bounds(self) -> bool
pub fn clip_to_bounds(self) -> bool
Whether the record cuts its content to its local bounds.
Sourcepub fn hit_test(self) -> Option<&'a HitTestNode>
pub fn hit_test(self) -> Option<&'a HitTestNode>
Pointer handling of the node.
Sourcepub fn has_hit_targets(self) -> bool
pub fn has_hit_targets(self) -> bool
Whether the record or a record beneath it handles pointers.
Sourcepub fn has_origin_sinks(self) -> bool
pub fn has_origin_sinks(self) -> bool
Whether the record’s subtree publishes live window origins: a text field’s popup anchor, a scroll container’s viewport rect.
Sourcepub fn has_space(self) -> bool
pub fn has_space(self) -> bool
Whether the record or a record beneath it is a scene, a mesh surface or a 3D transform.
Sourcepub fn own_draw_facts(self) -> OwnDrawFacts
pub fn own_draw_facts(self) -> OwnDrawFacts
What the record’s own draws hold that decides how a renderer snaps them to the pixel grid.
Sourcepub fn reach(self) -> Reach
pub fn reach(self) -> Reach
Where the record’s subtree draws, in its own space: what its items
draw and its children’s extents, within its clip. A change beneath
the record since SceneStore::refresh_reach leaves it unknown.
Sourcepub fn own_reach(self) -> Reach
pub fn own_reach(self) -> Reach
Where the record’s own draws reach, beside its children’s, in its
own space and within its clip. A change beneath the record since
SceneStore::refresh_reach leaves it unknown.
Sourcepub fn draws_within_bounds(self) -> bool
pub fn draws_within_bounds(self) -> bool
Whether everything the record’s subtree draws lies within its local
bounds, give or take crate::graph::CONTAINED_DRAW_SLACK.
Sourcepub fn isolation(self) -> IsolationReasons
pub fn isolation(self) -> IsolationReasons
The reasons the record is drawn through its own offscreen buffer.
Sourcepub fn needs_surface(self) -> bool
pub fn needs_surface(self) -> bool
Whether the record’s own composition needs its content on a texture of its own: a reason to draw offscreen, or a graphics layer that composites apart.
Sourcepub fn draw_phase(self) -> Option<PrimitivePhase>
pub fn draw_phase(self) -> Option<PrimitivePhase>
The phase a draw group paints in among its node’s own draws; None
for every other kind.
Sourcepub fn cache_policy(self) -> CachePolicy
pub fn cache_policy(self) -> CachePolicy
Whether a renderer may keep the record’s pixels between frames.
Sourcepub fn clip_rect(self) -> Option<Rect>
pub fn clip_rect(self) -> Option<Rect>
The rectangle that cuts the content and pointer hits: the local bounds when the record clips to them or its graphics layer clips.
Sourcepub fn shadow_clip(self) -> Option<Rect>
pub fn shadow_clip(self) -> Option<Rect>
Where the record’s own shadow is cut: its bounds when it clips its content to them. A graphics-layer clip leaves the shadow whole.
Sourcepub fn visual_clip_rect(self) -> Option<Rect>
pub fn visual_clip_rect(self) -> Option<Rect>
Where the record’s drawing is cut: its clip or, when it composites through an offscreen buffer for its alpha or by request, its bounds.
Sourcepub fn visual_clip_of(
self,
graphics: &GraphicsLayer,
bounds: Rect,
) -> Option<Rect>
pub fn visual_clip_of( self, graphics: &GraphicsLayer, bounds: Rect, ) -> Option<Rect>
Self::visual_clip_rect of the record whose graphics layer
graphics and local bounds bounds a reader holds already.
Sourcepub fn effect(self) -> Option<&'a RenderEffect>
pub fn effect(self) -> Option<&'a RenderEffect>
The render effect applied to the record’s content.
Sourcepub fn backdrop(self) -> Option<&'a RenderEffect>
pub fn backdrop(self) -> Option<&'a RenderEffect>
The effect applied to what lies behind the record.
Sourcepub fn blend_mode(self) -> BlendMode
pub fn blend_mode(self) -> BlendMode
How the record composites onto what lies beneath it.
Sourcepub fn color_filter(self) -> Option<&'a ColorFilter>
pub fn color_filter(self) -> Option<&'a ColorFilter>
The color filter applied to the record’s content.
Sourcepub fn target_content_hash(self) -> u64
pub fn target_content_hash(self) -> u64
Hash of everything the record draws into its target. Equal hashes mean cached pixels are still valid.
Sourcepub fn motion_source_content_hash(self) -> u64
pub fn motion_source_content_hash(self) -> u64
Hash of the record’s content like Self::target_content_hash,
without the translated content offset, so it stays equal while the
content only moves.
Sourcepub fn effect_hash(self) -> u64
pub fn effect_hash(self) -> u64
Hash of the record’s render effect, for keying cached effect output.
Sourcepub fn content_churns(self, update: SceneUpdate) -> bool
pub fn content_churns(self, update: SceneUpdate) -> bool
Whether what the record draws changed in scene update update and in
the one before it, so a raster cache keyed on its content would miss
again.
Sourcepub fn changes(self) -> RecordChanges
pub fn changes(self) -> RecordChanges
What the record and its subtree were at their last changes, and where it sat in its parent’s layer.
Sourcepub fn only_translated_since(self, held: RecordChanges) -> bool
pub fn only_translated_since(self, held: RecordChanges) -> bool
Whether the record itself, its properties, draws and items, changed
since held at most by the offset at which it moves its translated
content, whatever changed beneath it. A record that draws nothing of
its own keeps its children through such a change.
Sourcepub fn item_count(self) -> usize
pub fn item_count(self) -> usize
How many items the record holds.
Sourcepub fn item(self, index: usize) -> Option<ItemRef<'a>>
pub fn item(self, index: usize) -> Option<ItemRef<'a>>
The record’s item at index in draw order, read without the items
before it.
Sourcepub fn items(
self,
) -> impl DoubleEndedIterator<Item = ItemRef<'a>> + ExactSizeIterator + 'a
pub fn items( self, ) -> impl DoubleEndedIterator<Item = ItemRef<'a>> + ExactSizeIterator + 'a
The record’s items in draw order.
Sourcepub fn item_kinds(self) -> impl Iterator<Item = ItemKind> + 'a
pub fn item_kinds(self) -> impl Iterator<Item = ItemKind> + 'a
The kinds of the record’s items in draw order, read without the items themselves.
Sourcepub fn own_draws(self) -> impl Iterator<Item = ItemRef<'a>> + 'a
pub fn own_draws(self) -> impl Iterator<Item = ItemRef<'a>> + 'a
The record’s own draws in draw order: its items without its children.
Sourcepub fn children(self) -> impl DoubleEndedIterator<Item = Self> + 'a
pub fn children(self) -> impl DoubleEndedIterator<Item = Self> + 'a
The child records among the items, in draw order.