Bug 1518717 - Update webrender to commit ff9940fdf95412a3e5d1a70c78defba6e919c170 (WR PR #3488). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Wed, 09 Jan 2019 13:29:54 +0000
changeset 510130 e28e5537e3694721096382eb46dc47453372597d
parent 510129 e26702537a3b383f78e8b78741c6409f447c9b58
child 510149 29b2c2f578797279a9d55764da73158136081d89
child 510151 0eb6efe01bfbb46a7ac7018d9dfc46aac81c2cee
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)
reviewerskats
bugs1518717
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 1518717 - Update webrender to commit ff9940fdf95412a3e5d1a70c78defba6e919c170 (WR PR #3488). r=kats https://github.com/servo/webrender/pull/3488 Differential Revision: https://phabricator.services.mozilla.com/D16039
gfx/webrender_bindings/revision.txt
gfx/wr/webrender/src/freelist.rs
gfx/wr/webrender/src/texture_cache.rs
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-fb4b9342aa1b047ac46b89cb7a70987816bee686
+ff9940fdf95412a3e5d1a70c78defba6e919c170
--- a/gfx/wr/webrender/src/freelist.rs
+++ b/gfx/wr/webrender/src/freelist.rs
@@ -258,12 +258,13 @@ impl<T, M> FreeList<T, M> {
         self.active_count -= 1;
         let slot = &mut self.slots[id.index as usize];
         slot.next = self.free_list_head;
         slot.epoch = Epoch(slot.epoch.0 + 1);
         self.free_list_head = Some(id.index);
         slot.value.take().unwrap()
     }
 
+    #[allow(dead_code)]
     pub fn len(&self) -> usize {
         self.active_count
     }
 }
--- a/gfx/wr/webrender/src/texture_cache.rs
+++ b/gfx/wr/webrender/src/texture_cache.rs
@@ -521,42 +521,51 @@ impl TextureCache {
         cache.begin_frame(now);
         cache
     }
 
     pub fn set_debug_flags(&mut self, flags: DebugFlags) {
         self.debug_flags = flags;
     }
 
-    pub fn clear(&mut self) {
+    /// Clear all standalone textures in the cache.
+    pub fn clear_standalone(&mut self) {
         let standalone_entry_handles = mem::replace(
             &mut self.handles.standalone,
             Vec::new(),
         );
 
         for handle in standalone_entry_handles {
             let entry = self.entries.free(handle);
             entry.evict();
             self.free(entry);
         }
+    }
 
+    /// Clear all shared textures in the cache.
+    pub fn clear_shared(&mut self) {
         let shared_entry_handles = mem::replace(
             &mut self.handles.shared,
             Vec::new(),
         );
 
         for handle in shared_entry_handles {
             let entry = self.entries.free(handle);
             entry.evict();
             self.free(entry);
         }
 
-        assert!(self.entries.len() == 0);
+        self.shared_textures.clear(&mut self.pending_updates);
+    }
 
-        self.shared_textures.clear(&mut self.pending_updates);
+    /// Clear all entries in the texture cache. This is a fairly drastic
+    /// step that should only be called very rarely.
+    pub fn clear(&mut self) {
+        self.clear_standalone();
+        self.clear_shared();
     }
 
     /// Called at the beginning of each frame.
     pub fn begin_frame(&mut self, stamp: FrameStamp) {
         self.now = stamp;
         self.maybe_reclaim_shared_cache_memory();
     }
 
@@ -592,17 +601,17 @@ impl TextureCache {
         if self.shared_textures.empty_region_bytes() >= RECLAIM_THRESHOLD_BYTES {
             self.reached_reclaim_threshold.get_or_insert(self.now.time());
         } else {
             self.reached_reclaim_threshold = None;
         }
         if let Some(t) = self.reached_reclaim_threshold {
             let dur = self.now.time().duration_since(t).unwrap_or(Duration::default());
             if dur >= Duration::from_secs(5) {
-                self.clear();
+                self.clear_shared();
                 self.reached_reclaim_threshold = None;
             }
         }
 
     }
 
     pub fn end_frame(&mut self, texture_cache_profile: &mut TextureCacheProfileCounters) {
         // Expire standalone entries.