Bug 1519667 - Fix picture caching tiles being discarded incorrectly. r=kvark
authorGlenn Watson <github@intuitionlibrary.com>
Mon, 14 Jan 2019 15:49:22 +0000
changeset 510890 600fd2ac9a5ad2b5a9c1538b22bb1db010187e37
parent 510889 d7e16ec538fe14d06c476b906e2e92e899ee15d7
child 510891 b7f7558083b214c8a5b8919b41e730c93affebc9
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark
bugs1519667
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1519667 - Fix picture caching tiles being discarded incorrectly. r=kvark Differential Revision: https://phabricator.services.mozilla.com/D16401
gfx/wr/webrender/src/frame_builder.rs
--- a/gfx/wr/webrender/src/frame_builder.rs
+++ b/gfx/wr/webrender/src/frame_builder.rs
@@ -193,16 +193,26 @@ impl FrameBuilder {
     /// a frame builder is replaced with a newly built scene.
     pub fn destroy(
         self,
         retained_tiles: &mut RetainedTiles,
     ) {
         self.prim_store.destroy(
             retained_tiles,
         );
+
+        // In general, the pending retained tiles are consumed by the frame
+        // builder the first time a frame is built after a new scene has
+        // arrived. However, if two scenes arrive in quick succession, the
+        // frame builder may not have had a chance to build a frame and
+        // consume the pending tiles. In this case, the pending tiles will
+        // be lost, causing a full invalidation of the entire screen. To
+        // avoid this, if there are still pending tiles, include them in
+        // the retained tiles passed to the next frame builder.
+        retained_tiles.tiles.extend(self.pending_retained_tiles.tiles);
     }
 
     /// Compute the contribution (bounding rectangles, and resources) of layers and their
     /// primitives in screen space.
     fn build_layer_screen_rects_and_cull_layers(
         &mut self,
         clip_scroll_tree: &ClipScrollTree,
         pipelines: &FastHashMap<PipelineId, Arc<ScenePipeline>>,