cushy

Trait SimpleRenderOperation

source
pub trait SimpleRenderOperation:
    Send
    + Sync
    + 'static {
    // Required methods
    fn new(graphics: &mut Graphics<'_>) -> Self;
    fn render(
        &self,
        region: Rect<Px>,
        opacity: f32,
        graphics: &mut RenderingGraphics<'_, '_>,
    );
}
Expand description

A RenderOperation with no per-drawing-call state.

Required Methods§

source

fn new(graphics: &mut Graphics<'_>) -> Self

Returns a new instance of this render operation.

source

fn render( &self, region: Rect<Px>, opacity: f32, graphics: &mut RenderingGraphics<'_, '_>, )

Render to graphics at rect with opacity.

This operation’s will automatically be clipped to the available space for the context it is being drawn to. The render operation should project itself into region and only use the clip rect as an optimization. To test that this is handled correctly, try placing whatever is being rendered in a Scroll widget and ensure that as the contents are clipped, the visible area shows the correct contents.

Object Safety§

This trait is not object safe.

Implementors§