pub trait RenderBackend: Send + Sync {
// Required methods
fn backend_type(&self) -> BackendType;
fn create_pipeline(&self) -> Result<Box<dyn Pipeline>, RenderError>;
fn composite_layers(
&mut self,
layers: &[IntermediateLayer],
context: &RenderContext,
) -> Result<Vec<u8>, RenderError>;
// Provided methods
fn composite_layers_incremental(
&mut self,
layers: &[IntermediateLayer],
dirty_regions: &[DirtyRegion],
previous_frame: &[u8],
context: &RenderContext,
) -> Result<Vec<u8>, RenderError> { ... }
fn render_layers_to_bitmaps(
&mut self,
layers: &[IntermediateLayer],
context: &RenderContext,
) -> Result<Vec<RenderBitmap>, RenderError> { ... }
fn supports_feature(&self, feature: BackendFeature) -> bool { ... }
}Expand description
Core rendering backend trait
Required Methods§
Sourcefn backend_type(&self) -> BackendType
fn backend_type(&self) -> BackendType
Get the backend type
Sourcefn create_pipeline(&self) -> Result<Box<dyn Pipeline>, RenderError>
fn create_pipeline(&self) -> Result<Box<dyn Pipeline>, RenderError>
Create a pipeline for this backend
Sourcefn composite_layers(
&mut self,
layers: &[IntermediateLayer],
context: &RenderContext,
) -> Result<Vec<u8>, RenderError>
fn composite_layers( &mut self, layers: &[IntermediateLayer], context: &RenderContext, ) -> Result<Vec<u8>, RenderError>
Composite layers into final frame
Provided Methods§
Sourcefn composite_layers_incremental(
&mut self,
layers: &[IntermediateLayer],
dirty_regions: &[DirtyRegion],
previous_frame: &[u8],
context: &RenderContext,
) -> Result<Vec<u8>, RenderError>
fn composite_layers_incremental( &mut self, layers: &[IntermediateLayer], dirty_regions: &[DirtyRegion], previous_frame: &[u8], context: &RenderContext, ) -> Result<Vec<u8>, RenderError>
Composite layers incrementally (dirty regions only)
Sourcefn render_layers_to_bitmaps(
&mut self,
layers: &[IntermediateLayer],
context: &RenderContext,
) -> Result<Vec<RenderBitmap>, RenderError>
fn render_layers_to_bitmaps( &mut self, layers: &[IntermediateLayer], context: &RenderContext, ) -> Result<Vec<RenderBitmap>, RenderError>
Render layers to a positioned bitmap list (libass ASS_Image style)
instead of a composited frame buffer, skipping the full-frame clear/copy.
The default reports the backend does not support it.
Sourcefn supports_feature(&self, feature: BackendFeature) -> bool
fn supports_feature(&self, feature: BackendFeature) -> bool
Check if backend supports a specific feature
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".