pub trait BusHardwareFill: DisplayBus {
// Required method
async fn fill_solid(
&mut self,
cmd: &[u8],
color: SolidColor,
area: Area,
) -> Result<(), DisplayError<Self::Error>>;
}Expand description
An optional trait for buses that support hardware-accelerated solid color filling.
Filling a large area with a single color is a common operation (e.g., clearing the screen). If the hardware supports it (e.g., via a 2D GPU or a DMA channel with a non-incrementing source address), this trait allows the driver to offload that work, significantly reducing CPU usage and bus traffic.
Required Methods§
Sourceasync fn fill_solid(
&mut self,
cmd: &[u8],
color: SolidColor,
area: Area,
) -> Result<(), DisplayError<Self::Error>>
async fn fill_solid( &mut self, cmd: &[u8], color: SolidColor, area: Area, ) -> Result<(), DisplayError<Self::Error>>
Fills a specific region of the display with a solid color.
The implementation should leverage available hardware acceleration to perform this operation efficiently.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.