Present new frame only when damaged in iced_tiny_skia

This commit is contained in:
Héctor Ramón Jiménez 2023-04-05 18:41:40 +02:00
parent 1bba9a080f
commit 4ede482ab5
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 12 additions and 8 deletions

View file

@ -50,7 +50,7 @@ impl Backend {
viewport: &Viewport,
background_color: Color,
overlay: &[T],
) {
) -> bool {
let physical_size = viewport.physical_size();
let damage = if self.last_background_color == background_color
@ -62,7 +62,7 @@ impl Backend {
};
if damage.is_empty() {
return;
return false;
}
self.last_primitives = primitives.to_vec();
@ -179,6 +179,8 @@ impl Backend {
#[cfg(feature = "svg")]
self.vector_pipeline.trim_cache();
true
}
fn draw_primitive(