summaryrefslogtreecommitdiffstats
path: root/wgpu/src/image/vector.rs
diff options
context:
space:
mode:
authorLibravatar Malte Veerman <malte.veerman@gmail.com>2020-01-19 18:06:46 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-25 13:27:03 +0100
commit4617da2818eb3ecc17b1da9571b7baa15056c026 (patch)
tree2e8b6b23576e86feb4ed42995a1d3244224b7bd8 /wgpu/src/image/vector.rs
parent8f9f44b9e8ff1f1629d2b19edd2ecdad79e80836 (diff)
downloadiced-4617da2818eb3ecc17b1da9571b7baa15056c026.tar.gz
iced-4617da2818eb3ecc17b1da9571b7baa15056c026.tar.bz2
iced-4617da2818eb3ecc17b1da9571b7baa15056c026.zip
Implemented automatic deallocation of texture space for dropped allocations
Diffstat (limited to 'wgpu/src/image/vector.rs')
-rw-r--r--wgpu/src/image/vector.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/wgpu/src/image/vector.rs b/wgpu/src/image/vector.rs
index a8746566..98588e5c 100644
--- a/wgpu/src/image/vector.rs
+++ b/wgpu/src/image/vector.rs
@@ -130,16 +130,10 @@ impl Cache {
}
}
- pub fn trim(&mut self, texture_array: &mut TextureArray) {
+ pub fn trim(&mut self) {
let svg_hits = &self.svg_hits;
let rasterized_hits = &self.rasterized_hits;
- for (k, allocation) in &self.rasterized {
- if !rasterized_hits.contains(k) {
- texture_array.deallocate(allocation);
- }
- }
-
self.svgs.retain(|k, _| svg_hits.contains(k));
self.rasterized.retain(|k, _| rasterized_hits.contains(k));
self.svg_hits.clear();