Trait iced::widget::shader::Primitive

pub trait Primitive: Debug + Send + Sync + 'static {
    // Required methods
    fn prepare(
        &self,
        format: TextureFormat,
        device: &Device,
        queue: &Queue,
        bounds: Rectangle,
        target_size: Size<u32>,
        scale_factor: f32,
        storage: &mut Storage
    );
    fn render(
        &self,
        storage: &Storage,
        target: &TextureView,
        target_size: Size<u32>,
        viewport: Rectangle<u32>,
        encoder: &mut CommandEncoder
    );
}
Available on crate feature wgpu only.
Expand description

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

Required Methods§

fn prepare( &self, format: TextureFormat, device: &Device, queue: &Queue, bounds: Rectangle, target_size: Size<u32>, scale_factor: f32, storage: &mut Storage )

Processes the Primitive, allowing for GPU buffer allocation.

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

Renders the Primitive.

Implementors§