pub struct FbdevSurface { /* private fields */ }Expand description
A framebuffer, drawn into through a shadow buffer.
§Why a shadow buffer
The mapped framebuffer is being scanned out continuously; there is nothing to
flip to. Rendering into it directly would put every intermediate state on
screen — the clear before the redraw above all — which reads as flicker on
exactly the panels this backend exists for. So drawing goes to memory we own
and present copies out only the damaged rows.
That also makes the buffer age honest: the shadow persists frame to frame, so
it is BufferAge::Frames(1) and incremental repaint works
exactly as it does on DRM.
§What this cannot do
There is no page flip and no vsync. A copy that lands mid-scanout will tear,
and nothing here can prevent it — FBIO_WAITFORVSYNC is optional and widely
unimplemented. Keeping damage small keeps the tear small, which is the only
mitigation fbdev offers.
Implementations§
Source§impl FbdevSurface
impl FbdevSurface
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, FbdevError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, FbdevError>
Opens a specific node, such as /dev/fb0.
Sourcepub fn open_first() -> Result<Self, FbdevError>
pub fn open_first() -> Result<Self, FbdevError>
Opens the first framebuffer node that can be read and understood.
Trait Implementations§
Source§impl Debug for FbdevSurface
impl Debug for FbdevSurface
Source§impl Surface for FbdevSurface
impl Surface for FbdevSurface
Source§fn scale_factor(&self) -> f32
fn scale_factor(&self) -> f32
1.0 on a typical panel.