Skip to main content

CustomLayerHost

Trait CustomLayerHost 

Source
pub trait CustomLayerHost: Send + Sync {
    // Provided methods
    fn prerender(&self, _parameters: &mut CustomLayerPrerenderParameters<'_>) { ... }
    fn render(&self, _parameters: &mut CustomLayerRenderParameters<'_>) { ... }
    fn deinitialize(&self) { ... }
    fn context_lost(&self) { ... }
}
Expand description

Draws a custom layer with the host’s own GPU commands, on the thread that renders the map.

Each frame that shows the layer calls prerender for every custom layer, bottom to top, before the map’s render pass begins, then render at the layer’s place in the pass. Once a renderer stops drawing the layer, it calls deinitialize, or context_lost when the renderer’s graphics objects may be gone. The next prerender or render is for a new renderer, which can be on another device or backend.

Provided Methods§

Source

fn prerender(&self, _parameters: &mut CustomLayerPrerenderParameters<'_>)

Source

fn render(&self, _parameters: &mut CustomLayerRenderParameters<'_>)

Source

fn deinitialize(&self)

Destroy the GPU objects made for the renderer that stopped: the GPU no longer uses them.

Source

fn context_lost(&self)

Forget the GPU objects made for the renderer that stopped, without destroying them.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§