Avoid flushing empty layers in iced_wgpu and iced_glow

This commit is contained in:
Héctor Ramón Jiménez 2021-10-25 16:24:26 +07:00
parent 4a11cbd994
commit 687c35e052
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 9 additions and 0 deletions

View file

@ -79,6 +79,11 @@ impl Backend {
target_height: u32,
) {
let mut bounds = (layer.bounds * scale_factor).snap();
if bounds.width < 1 || bounds.height < 1 {
return;
}
bounds.height = bounds.height.min(target_height);
if !layer.quads.is_empty() {

View file

@ -119,6 +119,10 @@ impl Backend {
) {
let bounds = (layer.bounds * scale_factor).snap();
if bounds.width < 1 || bounds.height < 1 {
return;
}
if !layer.quads.is_empty() {
self.quad_pipeline.draw(
device,