pub struct Scene {Show 17 fields
pub shadows: Vec<Shadow>,
pub quads: Vec<Quad>,
pub backdrop_blur_rects: Vec<BackdropBlurRect>,
pub effect_quads: Vec<EffectQuad>,
pub effect_texture_sets: Vec<Arc<EffectTextureSet>>,
pub paths: Vec<PaintedPath>,
pub underlines: Vec<Underline>,
pub monochrome_sprites: Vec<MonochromeSprite>,
pub subpixel_sprites: Vec<SubpixelSprite>,
pub polychrome_sprites: Vec<PolychromeSprite>,
pub surfaces: Vec<PaintSurface>,
pub vn_layers: Vec<VnLayer>,
pub vn_layer_effects: Vec<Option<VnEffectLayer>>,
pub vn_effect_draws: Vec<VnEffectDraw>,
pub vn_clip_segments: Vec<[f32; 4]>,
pub vn_text_backgrounds: Vec<VnTextBackground>,
pub vn_captures: Vec<VnCapture>,
/* private fields */
}Fields§
§shadows: Vec<Shadow>§quads: Vec<Quad>§backdrop_blur_rects: Vec<BackdropBlurRect>§effect_quads: Vec<EffectQuad>§effect_texture_sets: Vec<Arc<EffectTextureSet>>vue-native fork: the images effect quads sample; EffectQuad::texture_set
indexes it.
paths: Vec<PaintedPath>§underlines: Vec<Underline>§monochrome_sprites: Vec<MonochromeSprite>§subpixel_sprites: Vec<SubpixelSprite>§polychrome_sprites: Vec<PolychromeSprite>§surfaces: Vec<PaintSurface>§vn_layers: Vec<VnLayer>vue-native fork: the composites of isolated layers
(Scene::vn_push_isolation), each drawing one group through its clip
shape. After Scene::finish every vector above holds the root group
first and then each isolated group’s, in Scene::vn_group_ranges.
vn_layer_effects: Vec<Option<VnEffectLayer>>vue-native fork: beside each of Scene::vn_layers, the effects that
composite it instead of its clip shape.
vn_effect_draws: Vec<VnEffectDraw>vue-native fork: the quads every VnEffectLayer draws, in no group’s
order (a layer names its run).
vn_clip_segments: Vec<[f32; 4]>vue-native fork: every isolated layer’s clip edges, [x0, y0, x1, y1]
in device pixels; a VnLayer names its run.
vn_text_backgrounds: Vec<VnTextBackground>Gradient stacks used by text-mask composites, shared across source groups.
vn_captures: Vec<VnCapture>vue-native fork: the groups painted for VnIsolation::capture,
which the renderer draws first and keeps as snapshots.
Implementations§
Source§impl Scene
impl Scene
pub fn clear(&mut self)
Sourcepub fn vn_push_isolation(&mut self, isolation: VnIsolation)
pub fn vn_push_isolation(&mut self, isolation: VnIsolation)
vue-native fork: opens an isolated layer. Every primitive inserted
until the matching Scene::vn_pop_isolation goes into a group of its
own, with its own draw orders: the renderer draws the group into an
offscreen target and composites it through isolation’s clip, at the
draw order the composite takes among its parent’s primitives.
The group is what CSS calls an isolated group: a backdrop filter in it sees what the group painted under it, not the page (the element is a Backdrop Root, Filter Effects 2 §3.1). The same group is where filters on an element’s own painting would apply.
Sourcepub fn vn_push_effect(&mut self, effect: VnEffectPaint)
pub fn vn_push_effect(&mut self, effect: VnEffectPaint)
vue-native fork: opens the group effect’s draws read as their content;
the matching Scene::vn_pop_isolation inserts them as one VnEffectLayer.
Sourcepub fn vn_begin_mask(&mut self, luminance: bool)
pub fn vn_begin_mask(&mut self, luminance: bool)
vue-native fork: what the innermost isolated layer paints from here to
its Scene::vn_pop_isolation is its mask: the group composites
multiplied by the mask’s alpha, or its luminance.
Sourcepub fn vn_is_isolating(&self) -> bool
pub fn vn_is_isolating(&self) -> bool
vue-native fork: whether an isolated layer is open.
Sourcepub fn vn_pop_isolation(&mut self)
pub fn vn_pop_isolation(&mut self)
vue-native fork: closes the innermost isolated layer
(Scene::vn_push_isolation) and inserts its composite.
Sourcepub fn vn_effect_layer(&self, index: usize) -> Option<VnEffectLayer>
pub fn vn_effect_layer(&self, index: usize) -> Option<VnEffectLayer>
vue-native fork: the VnEffectLayer that composites
Scene::vn_layers[index], if effects do.
Sourcepub fn vn_insert_snapshot(&mut self, paint: VnSnapshotPaint)
pub fn vn_insert_snapshot(&mut self, paint: VnSnapshotPaint)
vue-native fork: composites the snapshot paint.id at the current
draw position. Its mapping is settled after finish
(Scene::vn_resolve_snapshots), once every capture is known.
Sourcepub fn vn_resolve_snapshots(
&mut self,
known: impl Fn(u64) -> Option<(VnCaptureInfo, Bounds<ScaledPixels>)>,
)
pub fn vn_resolve_snapshots( &mut self, known: impl Fn(u64) -> Option<(VnCaptureInfo, Bounds<ScaledPixels>)>, )
vue-native fork: maps each snapshot composite’s unit square onto its
capture’s border box and names the snapshot’s rectangle. known finds
a capture of an earlier frame; one of this scene wins. A composite
whose capture is unknown draws nothing.
Sourcepub fn vn_group_count(&self) -> usize
pub fn vn_group_count(&self) -> usize
vue-native fork: how many groups a finished scene holds, the root included.
Sourcepub fn vn_batches(&self, group: usize) -> impl Iterator<Item = VnBatch> + '_
pub fn vn_batches(&self, group: usize) -> impl Iterator<Item = VnBatch> + '_
vue-native fork: the batches of one group (0 is the root), with its
isolated layers’ composites as VnBatch::Layers; a renderer that
isolates draws each composite’s VnLayer::group through these too.
pub fn len(&self) -> usize
pub fn push_layer(&mut self)
pub fn pop_layer(&mut self)
pub fn insert_primitive(&mut self, primitive: impl Into<Primitive>)
pub fn replay(&mut self, range: Range<usize>, prev_scene: &Scene)
pub fn finish(&mut self)
Sourcepub fn batches(&self) -> impl Iterator<Item = PrimitiveBatch> + '_
pub fn batches(&self) -> impl Iterator<Item = PrimitiveBatch> + '_
vue-native fork: an isolated layer’s group comes inline where its
composite would draw, unclipped by its shape (cut to the shape’s box by
the content mask). That is what a renderer without isolated layers
draws; the DirectX, Metal and wgpu renderers walk Scene::vn_batches.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Scene
impl !Sync for Scene
impl Forget for Scene
impl Freeze for Scene
impl Move for Scene
impl RefUnwindSafe for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
impl UnwindSafe for Scene
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more