pub struct Renderer { /* private fields */ }Expand description
Draws decorations.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(config: RendererConfig) -> Self
pub fn new(config: RendererConfig) -> Self
A renderer.
Sourcepub const fn has_font(&self) -> bool
pub const fn has_font(&self) -> bool
Whether a font is loaded, and so whether the title will be drawn.
Always false. Text is not implemented — see the module docs — and
answering true would have a caller reserve title-bar width for
something that never appears.
Sourcepub fn font_path(&self) -> Option<&str>
pub fn font_path(&self) -> Option<&str>
The configured font path, whether or not anything uses it.
Sourcepub fn draw(
&self,
theme: &Theme,
state: &WindowState,
canvas: &mut Canvas<'_>,
shadows: &mut ShadowCache,
) -> Result<(), DrawError>
pub fn draw( &self, theme: &Theme, state: &WindowState, canvas: &mut Canvas<'_>, shadows: &mut ShadowCache, ) -> Result<(), DrawError>
Draw a decoration for state onto canvas.
Deterministic: the same theme, state and size produce byte-identical output. That is what lets a caller skip a redraw it knows would change nothing, and it is why the panel’s dither is a hash of the coordinate rather than a random number.
§Errors
DrawError::EmptyCanvas for a zero-sized canvas, and
DrawError::Undersized if the buffer is shorter than its own stride
and height describe.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
impl UnwindSafe for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more