Skip to main content

TiledBackend

Struct TiledBackend 

Source
pub struct TiledBackend<T> { /* private fields */ }
Expand description

Adapts a one-active-tile renderer to the frame-level backend contract.

Implementations§

Source§

impl<T> TiledBackend<T>

Source

pub const fn new(renderer: T) -> Self

Wraps a tile renderer.

Source

pub const fn renderer(&self) -> &T

Returns the wrapped renderer.

Source

pub fn renderer_mut(&mut self) -> &mut T

Returns the wrapped renderer mutably.

Source

pub fn into_inner(self) -> T

Unwraps the tile renderer.

Trait Implementations§

Source§

impl<I, R, T, const N: usize> RenderBackend<I, N, R> for TiledBackend<T>
where I: SceneItem, R: ?Sized, T: TileRenderer<I, R>,

Source§

type Error = TiledRenderError<<T as TileRenderer<I, R>>::Error>

The backend error.
Source§

async fn render_frame<'a>( &'a mut self, frame: FrameView<'a, I, N>, resources: &'a R, ) -> Result<(), Self::Error>
where I: 'a, R: 'a,

Renders one logical frame. Preparation that can fail should happen before the first visible display write.
Source§

impl<I, R, T> TileRenderer<I, R> for TiledBackend<T>
where I: SceneItem, R: ?Sized, T: TileRenderer<I, R>,

Source§

type Error = <T as TileRenderer<I, R>>::Error

The backing renderer error.
Source§

fn viewport(&self) -> Bounds

Returns the stable viewport used for this render.
Source§

fn tile_size(&self) -> TileSize

Returns the damage tile dimensions.
Source§

fn preflight<const N: usize>( &mut self, frame: FrameView<'_, I, N>, resources: &R, ) -> Result<(), Self::Error>

Resolves resources and optionally prepares the frame before display writes. Read more
Source§

fn object_coverage( &self, object: Instance<'_, I>, tile: Bounds, resources: &R, ) -> TileCoverage

Classifies the pixels this backend would produce for object in tile. Read more
Source§

fn object_may_change( &self, old: Instance<'_, I>, new: Instance<'_, I>, tile: Bounds, resources: &R, ) -> bool

Returns whether replacing old with new may change this backend’s tile-local output. Read more
Source§

fn object_change( &self, old: Instance<'_, I>, new: Instance<'_, I>, tile: Bounds, resources: &R, ) -> TileChange

Returns the proof status behind the old/new change decision.
Source§

fn begin_tile(&mut self, tile: Bounds) -> Result<(), Self::Error>

Selects the active tile.
Source§

fn clear_tile(&mut self) -> Result<(), Self::Error>

Clears the active tile to the renderer’s background color.
Source§

fn prefers_clear_before_full(&self) -> bool

Returns whether this backend prefers a clear even when a proven TileCoverage::Full item will immediately initialize the whole tile. Read more
Source§

fn draw_item( &mut self, object: Instance<'_, I>, resources: &R, ) -> Result<(), Self::Error>

Draws an object after applying its transform, clipped to the active tile. Read more
Source§

fn flush_tile<'a>( &'a mut self, ) -> impl Future<Output = Result<(), Self::Error>> + 'a
where I: 'a, R: 'a,

Flushes the active tile to the backing display.
Source§

fn finish_frame<'a>( &'a mut self, ) -> impl Future<Output = Result<(), Self::Error>> + 'a
where I: 'a, R: 'a,

Completes any tile transfers still owned by the backend. Read more

Auto Trait Implementations§

§

impl<T> Freeze for TiledBackend<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for TiledBackend<T>
where T: RefUnwindSafe,

§

impl<T> Send for TiledBackend<T>
where T: Send,

§

impl<T> Sync for TiledBackend<T>
where T: Sync,

§

impl<T> Unpin for TiledBackend<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for TiledBackend<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for TiledBackend<T>
where T: 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, 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.