pub trait TargetPixelBuffer {
type TargetPixel: TargetPixel;
// Required methods
fn line_slice(&mut self, line_number: usize) -> &mut [Self::TargetPixel];
fn num_lines(&self) -> usize;
// Provided methods
fn fill_background(
&mut self,
_brush: &Brush,
_region: &PhysicalRegion,
) -> bool { ... }
fn draw_rectangle(
&mut self,
_: &DrawRectangleArgs,
_clip: &PhysicalRegion,
) -> bool { ... }
fn draw_texture(
&mut self,
_: &DrawTextureArgs,
_clip: &PhysicalRegion,
) -> bool { ... }
}experimental only.Expand description
This trait represents access to a buffer of pixels the software renderer can render into, as well as certain operations that the renderer will try to delegate to this trait. Implement these functions to delegate rendering further to hardware-provided 2D acceleration units, such as DMA2D or PXP.
Required Associated Types§
Sourcetype TargetPixel: TargetPixel
type TargetPixel: TargetPixel
The pixel type the buffer represents.
Required Methods§
Sourcefn line_slice(&mut self, line_number: usize) -> &mut [Self::TargetPixel]
fn line_slice(&mut self, line_number: usize) -> &mut [Self::TargetPixel]
Returns a slice of pixels for the given line.
Provided Methods§
Sourcefn fill_background(&mut self, _brush: &Brush, _region: &PhysicalRegion) -> bool
fn fill_background(&mut self, _brush: &Brush, _region: &PhysicalRegion) -> bool
Fill the background of the buffer with the given brush.
Sourcefn draw_rectangle(
&mut self,
_: &DrawRectangleArgs,
_clip: &PhysicalRegion,
) -> bool
fn draw_rectangle( &mut self, _: &DrawRectangleArgs, _clip: &PhysicalRegion, ) -> bool
Draw a rectangle specified by the DrawRectangleArgs. That rectangle must be clipped to the given region
Sourcefn draw_texture(&mut self, _: &DrawTextureArgs, _clip: &PhysicalRegion) -> bool
fn draw_texture(&mut self, _: &DrawTextureArgs, _clip: &PhysicalRegion) -> bool
Draw a texture into the buffer. The texture must be clipped to the given region. Returns true if the operation was successful; false if it could not be implemented and instead the software renderer needs to draw the texture