Skip to content

Commit 0c6b52e

Browse files
author
bors-servo
authored
Auto merge of #3365 - gw3583:fix-retain, r=kvark
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. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3365) <!-- Reviewable:end -->
2 parents 3d73e38 + 82440f3 commit 0c6b52e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

webrender/src/frame_builder.rs

+8
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

-8
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)