always increment quad, mesh, text and image layer counts in wgpu layer rendering
This commit is contained in:
parent
a687a83765
commit
c90d153976
1 changed files with 29 additions and 5 deletions
|
|
@ -268,13 +268,37 @@ impl Renderer {
|
||||||
let scale = Transformation::scale(scale_factor);
|
let scale = Transformation::scale(scale_factor);
|
||||||
|
|
||||||
for layer in self.layers.iter() {
|
for layer in self.layers.iter() {
|
||||||
let Some(physical_bounds) =
|
let Some(scissor_rect) = physical_bounds
|
||||||
physical_bounds.intersection(&(layer.bounds * scale))
|
.intersection(&(layer.bounds * scale))
|
||||||
|
.and_then(Rectangle::snap)
|
||||||
else {
|
else {
|
||||||
continue;
|
if !layer.quads.is_empty() {
|
||||||
};
|
quad_layer += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if !layer.triangles.is_empty() {
|
||||||
|
mesh_layer += layer
|
||||||
|
.triangles
|
||||||
|
.iter()
|
||||||
|
.filter(|item| {
|
||||||
|
matches!(item, triangle::Item::Group { .. })
|
||||||
|
})
|
||||||
|
.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
if !layer.text.is_empty() {
|
||||||
|
text_layer += layer
|
||||||
|
.text
|
||||||
|
.iter()
|
||||||
|
.filter(|item| matches!(item, text::Item::Group { .. }))
|
||||||
|
.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "svg", feature = "image"))]
|
||||||
|
if !layer.images.is_empty() {
|
||||||
|
image_layer += 1;
|
||||||
|
}
|
||||||
|
|
||||||
let Some(scissor_rect) = physical_bounds.snap() else {
|
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue