Skip to content

Commit

Permalink
Properly evict cached blob tiles when they are out of the visible area.
Browse files Browse the repository at this point in the history
  • Loading branch information
nical committed Oct 30, 2018
1 parent f3d6f13 commit ab8ed4e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions webrender/src/resource_cache.rs
Expand Up @@ -1202,6 +1202,20 @@ impl ResourceCache {
);

tiles.retain(|tile, _| { tile_range.contains(tile) });

let texture_cache = &mut self.texture_cache;
match self.cached_images.try_get_mut(&key) {
Some(&mut ImageResult::Multi(ref mut entries)) => {
entries.retain(|key, entry| {
if key.tile.is_none() || tile_range.contains(&key.tile.unwrap()) {
return true;
}
texture_cache.mark_unused(&entry.texture_cache_handle);
return false;
});
}
_ => {}
}
}

pub fn request_glyphs(
Expand Down

0 comments on commit ab8ed4e

Please sign in to comment.