pub trait Primitive: Debug + Send + Sync + 'static {
    // Required methods
    fn prepare(
        &self,
        device: &Device,
        queue: &Queue,
        format: TextureFormat,
        storage: &mut Storage,
        bounds: &Rectangle,
        viewport: &Viewport
    );
    fn render(
        &self,
        encoder: &mut CommandEncoder,
        storage: &Storage,
        target: &TextureView,
        clip_bounds: &Rectangle<u32>
    );
}
Expand description

A set of methods which allows a Primitive to be rendered.

Required Methods§

source

fn prepare( &self, device: &Device, queue: &Queue, format: TextureFormat, storage: &mut Storage, bounds: &Rectangle, viewport: &Viewport )

Processes the Primitive, allowing for GPU buffer allocation.

source

fn render( &self, encoder: &mut CommandEncoder, storage: &Storage, target: &TextureView, clip_bounds: &Rectangle<u32> )

Renders the Primitive.

Implementors§