Skip to main content

CommandRecorder

Struct CommandRecorder 

Source
pub struct CommandRecorder<D> {
    pub scene_size: SizeU16,
    pub nodes: Vec<Node>,
    pub draws: Vec<D>,
    pub layers: Vec<RecordedLayer>,
    pub filter_layers: Vec<u32>,
    pub root_is_blend_target: bool,
    pub max_layer_depth: usize,
    pub largest_layer_size: Option<SizeU16>,
    pub largest_filter_layer_size: Option<SizeU16>,
    pub has_non_default_blend: bool,
    active_layer: Option<u32>,
    layer_stack: Vec<OpenLayer>,
}
Expand description

Recorder for a scene description.

Fields§

§scene_size: SizeU16

Tile-aligned dimensions of the root scene.

§nodes: Vec<Node>

The nodes of the root layer.

§draws: Vec<D>

Flat storage for all draw commands that are part of the recording.

§layers: Vec<RecordedLayer>

Data about recorded layers, indexed by their ID.

§filter_layers: Vec<u32>

IDs of recorded filter layers in creation order.

§root_is_blend_target: bool

Whether the root is the target of a non-default blending operation.

§max_layer_depth: usize

Maximum layer depth across the whole layer graph.

§largest_layer_size: Option<SizeU16>

The largest dimensions of any recorded layer.

§largest_filter_layer_size: Option<SizeU16>

The largest dimensions of any recorded filter layer.

§has_non_default_blend: bool

Whether there exists at least one layer that uses a non-default blend mode.

§active_layer: Option<u32>

The layer whose command stream is currently the base.

This is None if there is no active layer and we are recording into the root layer instead.

§layer_stack: Vec<OpenLayer>

Stack of currently pushed layers.

Implementations§

Source§

impl<D> CommandRecorder<D>

Source

pub fn new(width: u16, height: u16) -> Self

Create a new command recorder.

Source

pub fn has_layers(&self) -> bool

Whether any layers are currently open.

Source

pub fn reset(&mut self, width: u16, height: u16)

Reset the command recorder.

Source

pub fn push_layer(&mut self, props: LayerProps, filter_plan: Option<FilterData>)

Push a new layer.

Source

fn push_regular_layer(&mut self, props: LayerProps)

Source

fn push_filter_layer(&mut self, props: LayerProps, filter_plan: FilterData)

Source

fn push_recorded_layer(&mut self, layer: RecordedLayer) -> u32

Source

pub fn pop_layer(&mut self) -> PoppedLayer

Pop the currently active layer.

Source

fn active_node_mut(&mut self) -> Option<&mut Node>

Source

fn push_node(&mut self, node: Node)

Source

fn push_layer_node(&mut self, layer_id: u32)

Source

fn push_layer_metadata(&mut self, layer: RecordedLayer) -> u32

Source

fn record_bbox(&mut self, bbox: impl FnOnce() -> Option<RectU16>)

Source§

impl<D: Drawable> CommandRecorder<D>

Source

pub fn push_draw(&mut self, draw: D, strips: &[Strip])

Push a draw command.

Trait Implementations§

Source§

impl<D: Debug> Debug for CommandRecorder<D>

Source§

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

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

impl<D> Default for CommandRecorder<D>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<D> Freeze for CommandRecorder<D>

§

impl<D> RefUnwindSafe for CommandRecorder<D>
where D: RefUnwindSafe,

§

impl<D> Send for CommandRecorder<D>
where D: Send,

§

impl<D> Sync for CommandRecorder<D>
where D: Sync,

§

impl<D> Unpin for CommandRecorder<D>
where D: Unpin,

§

impl<D> UnsafeUnpin for CommandRecorder<D>

§

impl<D> UnwindSafe for CommandRecorder<D>
where D: UnwindSafe,

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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.