pub struct Drawing {
pub list: List,
pub images: Vec<ImageData>,
/* private fields */
}Expand description
A scene laid out, in one theme, and made into its display list: kept, so a later scene updates it by what changed. Its layout tree, every node’s box by its id, the property-tree nodes each node made, the list, and the images the list paints.
Fields§
§list: ListThe display list: chunks under property trees, and their index.
images: Vec<ImageData>Every image the list paints, each under a blob of its own, in the
order the list first paints it: what the GPU’s atlas holds for this
drawing, placed as crate::atlas::place places them.
Implementations§
Source§impl Drawing
impl Drawing
Sourcepub fn area(&self) -> Frame
pub fn area(&self) -> Frame
The design’s drawing: its root’s box plus anything painted outside it, cut by any clipping frame, in whole pixels.
Sourcepub fn frames(&self) -> Vec<Frame>
pub fn frames(&self) -> Vec<Frame>
Every node’s box, in tree order, in the design’s coordinates.
pub fn theme(&self) -> Theme
Sourcepub fn view_tiles(&self, view: &View) -> Vec<(u32, u32)>
pub fn view_tiles(&self, view: &View) -> Vec<(u32, u32)>
The tiles view needs at its own zoom’s level, nearest its middle
first: what a compositor asks to be painted.
Sourcepub fn action_at(&self, x: f32, y: f32) -> Option<&str>
pub fn action_at(&self, x: f32, y: f32) -> Option<&str>
The interaction of the topmost node at (x, y) — in the design’s
coordinates — that has one, where its clipping frames show it.
Sourcepub fn update(
&mut self,
renderer: &mut Renderer,
new: &Scene,
applied: &Applied,
) -> Result<Damage, Undrawable>
pub fn update( &mut self, renderer: &mut Renderer, new: &Scene, applied: &Applied, ) -> Result<Damage, Undrawable>
Updates the drawing to new by the patch that made it: applied,
what crate::wire::apply did to the scene the drawing showed — the
subtrees removed and placed and the nodes changed, by id. Only those
are laid out and painted again, and nodes that only moved keep their
chunks — the work is the patch’s, never the scene’s. The damage it
returns is what changed; or why new can’t be painted — its images
too many for the GPU’s atlas — in which case the drawing is new’s
all the same.
Sourcepub fn prepare(&mut self, renderer: &mut Renderer, scene: &Scene, area: KRect)
pub fn prepare(&mut self, renderer: &mut Renderer, scene: &Scene, area: KRect)
Rounds anew, before area — in the design’s coordinates — is painted,
hit or read, the children of runs there that an update moved by a
fraction of a pixel: an update moves them by the sums alone and leaves
their boxes and chunks as they were, so an edit costs what it changed
and the rounding costs what is read. scene is the scene the drawing
shows. After it, the drawing there is a fresh one’s, box for box.
Sourcepub fn prepare_all(&mut self, renderer: &mut Renderer, scene: &Scene)
pub fn prepare_all(&mut self, renderer: &mut Renderer, scene: &Scene)
Drawing::prepare over the whole drawing.
Sourcepub fn update_between(
&mut self,
renderer: &mut Renderer,
old: &mut Scene,
new: &Scene,
) -> Result<Damage, Undrawable>
pub fn update_between( &mut self, renderer: &mut Renderer, old: &mut Scene, new: &Scene, ) -> Result<Damage, Undrawable>
Drawing::update from old, the scene the drawing shows, to the
content of new, by the patch between them — old patched to it,
keeping its places, so it stays the scene the drawing shows: for a
caller holding both.