iced::widget::shader

Trait Primitive

Source
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>,
    );
}
Available on crate feature wgpu only.
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§