Skip to content

Commit 82440f3

Browse files
committed
Fix a bug in invalidating tiles from a previous scene.
Any retained tiles from a previous scene were being dropped if not used after building the dirty region for the first tile cache. This works in simple applications, but in Gecko, where multiple tile caches exist, it means that we were dropping any retained tiles that other tile caches may want, after the first tile cache updated. Instead, only drop previous scene tiles after all tile caches have had a chance to retain tiles.
1 parent 3d73e38 commit 82440f3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

webrender/src/frame_builder.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ impl FrameBuilder {
278278
&mut retained_tiles,
279279
);
280280

281+
// If we had any retained tiles from the last scene that were not picked
282+
// up by the new frame, then just discard them eagerly.
283+
// TODO(gw): Maybe it's worth keeping them around for a bit longer in
284+
// some cases?
285+
for (_, handle) in retained_tiles.drain() {
286+
resource_cache.texture_cache.mark_unused(&handle);
287+
}
288+
281289
let mut frame_state = FrameBuildingState {
282290
render_tasks,
283291
profile_counters,

webrender/src/picture.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -857,14 +857,6 @@ impl TileCache {
857857
}
858858
}
859859

860-
// If we had any retained tiles from the last scene that were not picked
861-
// up by the new frame, then just discard them eagerly.
862-
// TODO(gw): Maybe it's worth keeping them around for a bit longer in
863-
// some cases?
864-
for (_, handle) in retained_tiles.drain() {
865-
resource_cache.texture_cache.mark_unused(&handle);
866-
}
867-
868860
self.dirty_region = if dirty_rect.is_empty() {
869861
None
870862
} else {

0 commit comments

Comments
 (0)