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 forget_captures(&mut self, gone: &[u64])
pub fn forget_captures(&mut self, gone: &[u64])
Drops the scaled frames kept for screencopy views gone, at once:
each is as large as its view, and an idle shell may draw nothing
for a long while.
Sourcepub fn next_image_frame(&mut self, now: Instant) -> Option<Instant>
pub fn next_image_frame(&mut self, now: Instant) -> Option<Instant>
When the next frame of an animated GIF is due, counting from now
for one drawn since the last call. None while no GIF drawn plays.
The platform wakes then and calls
advance_images.
Sourcepub fn advance_images(&mut self, now: Instant) -> Vec<u64>
pub fn advance_images(&mut self, now: Instant) -> Vec<u64>
Moves each GIF whose next frame is due by now on to it, and returns
their image ids for the platform to repaint with
Window::repaint_image. A
GIF waits for its next frame only once that one is drawn, so one no
longer shown wakes nothing more.
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.