pub struct Renderer { /* private fields */ }Expand description
The fonts and text layout state a renderer keeps between paints.
Implementations§
Source§impl Renderer
impl Renderer
pub fn new() -> Renderer
Sourcepub fn layout(&mut self, scene: &Scene) -> Vec<Frame>
pub fn layout(&mut self, scene: &Scene) -> Vec<Frame>
Lays the scene out: every node’s box, in tree order.
Sourcepub fn display_list(&mut self, scene: &Scene) -> (Frame, Vec<Draw>)
pub fn display_list(&mut self, scene: &Scene) -> (Frame, Vec<Draw>)
The scene as drawing commands — laid out once, shaped once — and the area they cover: the design’s drawing, its root’s box plus anything painted outside it, in whole pixels. The list is clipped to that area, so every backend shows exactly it.
Sourcepub fn drawing(
&mut self,
scene: &Scene,
after: Option<&Drawing>,
) -> Result<Drawing, Undrawable>
pub fn drawing( &mut self, scene: &Scene, after: Option<&Drawing>, ) -> Result<Drawing, Undrawable>
The scene laid out once and turned into its display list, or why it
can’t be drawn: a drawing bigger than MAX_SIDE a side, or images and
shadows that don’t fit the GPU’s atlas together. What the PNG, the
canvas and devpage check all start from.
Each image is painted under a blob of its own, made in the order the
drawing first paints it — except that a drawing made after the one
a canvas last showed, painting the same images in the same order,
paints that drawing’s: the GPU then keeps the atlas it has, which
holds exactly them, placed as a fresh one would.