pub struct Renderer { /* private fields */ }Expand description
Draws windows. One serves every window; it holds the glyph and icon caches.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn set_icon_theme(&mut self, theme: impl Into<String>)
pub fn set_icon_theme(&mut self, theme: impl Into<String>)
Sets the icon theme names are looked up in.
Sourcepub fn draw(
&mut self,
view: &WindowView<'_>,
damage: &[Rect],
text: &mut TextSystem,
history: &mut DamageHistory,
canvas: Canvas<'_>,
) -> Result<Vec<PixelRect>, CanvasError>
pub fn draw( &mut self, view: &WindowView<'_>, damage: &[Rect], text: &mut TextSystem, history: &mut DamageHistory, canvas: Canvas<'_>, ) -> Result<Vec<PixelRect>, CanvasError>
Draws the laid-out window view into canvas and returns the areas
to report with wl_surface.damage_buffer.
damage is what the window reported since the last draw, from
Window::take_damage. The draw
repaints that, plus what changed in frames this buffer missed
according to history, or the whole buffer when that is more than
half of it or the buffer is new. Text and glyphs come from text.
Commit the buffer after every successful draw, in order: the history counts each one as a frame the compositor showed.
§Errors
If canvas holds the wrong number of bytes for its size, or its
scale isn’t a positive number. Nothing is drawn and the history
doesn’t advance.