Skip to main content

blit_gui/damage/
mod.rs

1use alloc::vec::Vec;
2use core::ops::Range;
3
4use blit::PhysicalRect;
5
6pub mod command;
7pub mod tile;
8
9use crate::display_list::DisplayList;
10
11pub trait DamageTracker {
12    fn update(&mut self, input: &DisplayList, screen: PhysicalRect, scale: f32, buffer_age: u8);
13    fn invalidate(&mut self);
14    fn is_empty(&self) -> bool;
15    fn intersects(&self, bounds: PhysicalRect, clip: u32) -> bool;
16    /// writes sorted disjoint spans valid until the returned vertical boundary
17    fn line_ranges(&self, line: i32, bounds: PhysicalRect, ranges: &mut Vec<Range<usize>>) -> i32;
18    /// may swap the rendered list for one the renderer clears and reuses
19    fn finish_frame(&mut self, _rendered: &mut DisplayList) {}
20}