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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
WR Updater Bot 2019-01-09 13:29:54 +00:00
Родитель eafd30566c
Коммит 8519596937
3 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -1 +1 @@
fb4b9342aa1b047ac46b89cb7a70987816bee686
ff9940fdf95412a3e5d1a70c78defba6e919c170

Просмотреть файл

@ -263,6 +263,7 @@ impl<T, M> FreeList<T, M> {
slot.value.take().unwrap()
}
#[allow(dead_code)]
pub fn len(&self) -> usize {
self.active_count
}

Просмотреть файл

@ -526,7 +526,8 @@ impl TextureCache {
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(),
@ -537,7 +538,10 @@ impl TextureCache {
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(),
@ -549,11 +553,16 @@ impl TextureCache {
self.free(entry);
}
assert!(self.entries.len() == 0);
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;
@ -597,7 +606,7 @@ impl TextureCache {
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;
}
}