Skip to main content

RenderSession

Struct RenderSession 

Source
pub struct RenderSession { /* private fields */ }

Implementations§

Source§

impl RenderSession

Source

pub fn new(config: RenderConfig) -> Self

Source

pub fn add_plan(&mut self, index: u32, plan: &FramePlan)

Hands over a stored plan before the first frame is rendered: the session reads every plan’s moving-region placements to find where each canvas’s page ends (elastic overscroll, docs/ARCHITECTURE.md §十). A host that hands over none renders as if no page had edges.

Source

pub fn configure_tiles( &self, cache: &mut TileCache, memory_mb: f64, ) -> Option<Diagnostic>

Sizes the tile cache for this pass: the memory setting less what the pass itself holds (the ring’s frames and the frame-sized planes around them, each fixed region’s saved copy and history, 8 MB of headroom), then raised to what one frame paints. Returns the MEMORY_BUDGET_RAISED diagnostic (info) when it had to raise the limit: from, to and mb for the message, and a { budgetMB, tiles, raisedBy } detail.

Source

pub fn counters(&self) -> RenderCounters

Source

pub fn meta(&self, canvas: &str) -> Option<CanvasMeta>

The canvas’s metadata as the pass holds it now, if it has been loaded.

Source

pub fn take_events(&mut self) -> Vec<Diagnostic>

Diagnostics raised since the last call, in emission order: NONFINITE_POSE (error; a placement’s resolved pose cannot be placed, it is recorded as skipped at (0, 0)), and the compositor’s INCOMPLETE_TEMPORAL_PATCH and TEMPORAL_OR_ALIGNMENT_CONFLICT (warnings; conflicts the pixels detected before patching, every conflicting rect in detail.regions).

Source

pub fn take_dirty_metas(&mut self) -> Vec<(String, CanvasMeta)>

Canvases whose metadata changed since the last call, in the order they first changed, with their current values.

Source

pub fn wanted_votes( &self, index: u32, has_prev: bool, has_next: bool, ) -> Vec<i64>

The consistency/<frame> records the host should read for frame index (in this order) before RenderSession::begin: the frame’s own, then its previous and next frame’s when those are in hand, leaving out what the window still holds.

Source

pub fn begin( &mut self, input: FrameInput, votes: Vec<(i64, Option<ConsistencyRecord>)>, ) -> Result<(), RenderError>

Starts compositing one frame. votes are the records RenderSession::wanted_votes named, None where no row is stored.

Source

pub fn cancel(&mut self, compositor: &mut Compositor)

Abandons the frame in progress (the host failed or stopped between steps), and the compositor’s placement with it. What the frame already changed (metadata, saved fixed-region pixels, last placements) stays, as it did when the pass failed mid-frame before.

Source

pub fn provide_meta(&mut self, canvas: &str, meta: Option<CanvasMeta>)

Hands over the metadata of the canvas RenderStep::NeedMeta asked for; None when no row is stored (the next step then fails).

Source

pub fn frame_slot(&mut self, index: u32) -> &mut [u8] ⓘ

The ring slot frame index goes into, for the host to write its RGBA after RenderStep::NeedFrame. The slot filled longest ago is reused, but never one holding the frame in progress or either of its neighbours.

Source

pub fn step(&mut self, io: &mut RenderIo<'_>) -> Result<RenderStep, RenderError>

Runs the frame until it needs something from the host or is done. On an error the frame is abandoned (and the compositor’s placement cancelled); the session stays usable.

Source

pub fn begin_finish(&mut self) -> Result<bool, RenderError>

Ends the run’s fixed regions after the last frame: each one’s first epoch closes and its first frame without transients is worked out, and a region whose state kept changing (more than [DYNAMIC_SHARE] of its frames, and more than [DYNAMIC_FRAMES], settled into a new state) gets its first frame back on its canvas, as it was, instead of its last state. Returns whether there is anything to paint; when there is, step the session as for a frame until RenderStep::Done (its observation is empty and is not a ledger row). Call once, after the last frame.

Source

pub fn patch_reference( &self, rgba: &mut [u8], width: usize, height: usize, frame: u32, ) -> bool

Paints every fixed region’s first frame without transients into rgba (width × height, the reference frame frame), after RenderSession::begin_finish; returns whether any pixel changed. Regions whose first observation was another frame are left alone.

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.