Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic when updating a non-tiled "multi" image cache entry. #3354

Merged
merged 1 commit into from Nov 26, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix panic when updating a non-tiled multi image cache entry.

  • Loading branch information
nical committed Nov 26, 2018
commit 76cfa92111472d69279b70e2c73f70cc86bc82c6
@@ -794,11 +794,10 @@ impl ResourceCache {
entry.dirty_rect = entry.dirty_rect.union(dirty_rect);
}
Some(&mut ImageResult::Multi(ref mut entries)) => {
let tile_size = tiling.unwrap();
for (key, entry) in entries.iter_mut() {
// We want the dirty rect relative to the tile and not the whole image.
let local_dirty_rect = match key.tile {
Some(tile) => {
let local_dirty_rect = match (tiling, key.tile) {
(Some(tile_size), Some(tile)) => {
dirty_rect.map(|mut rect|{
let tile_offset = DeviceIntPoint::new(
tile.x as i32,
@@ -809,7 +808,8 @@ impl ResourceCache {
rect
})
}
None => *dirty_rect,
(None, Some(..)) => DirtyRect::All,
_ => *dirty_rect,
};
entry.dirty_rect = entry.dirty_rect.union(&local_dirty_rect);
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.